caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* A macro system compatible with modules
@ 2007-06-20 12:17 Loup Vaillant
  2007-06-20 12:52 ` [Caml-list] " Pietro Abate
  0 siblings, 1 reply; 2+ messages in thread
From: Loup Vaillant @ 2007-06-20 12:17 UTC (permalink / raw)
  To: Caml List

Hello,

I would like to define a macro system (like #define) which satisfy the
following constraints :

-> When I define a macro, it is available for use right now, in the
same compilation unit.
-> If I want to call the macro from another compilation unit, I just
have to either open the corresponding module :

open My_comp_unit;;
(* some code *)
my_macro (* macro arguments *)

or access the macro through indirection :

My_comp_unit.my_macro (* macro arguments *)

-> [optional] a macro must declared in the .mli file to be accessible
from the outside, and is automatically accessible if this .mli file is
not defined by the author of the compilation unit.
-> [optional] do the same things for any module (defined as is, or
from a functor)

This would be ideal for avoiding namespaces issues.

What about plain camlp4 macros?
What about the #define defined in camlp4?
Is such a a thing possible?
To what extent?

Thanks,
Loup Vaillant

(reminder
  my ultimate goal is Lisp-like macros)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-06-20 12:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-20 12:17 A macro system compatible with modules Loup Vaillant
2007-06-20 12:52 ` [Caml-list] " Pietro Abate

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).