caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* camlp4 pa_macro
@ 2005-09-06  8:07 Dmitry Bely
  2005-09-06 19:35 ` [Caml-list] camlp4 pa_macro (doc request) Martin Jambon
  2005-09-07 12:03 ` Peter Jolly
  0 siblings, 2 replies; 10+ messages in thread
From: Dmitry Bely @ 2005-09-06  8:07 UTC (permalink / raw)
  To: caml-list

Is it possible to achieve with pa_macro something like this:

IFDEF NDEBUG THEN
DEFINE LOG(expr) = ()
ELSE
DEFINE LOG(expr) = Printf.printf expr
ENDIF
...
LOG("x=%d,y=%d" x y);

Unfortunately the code above does not work: debug version is OK, but then
NDEBUG is turned on I have

"This expression is not a function, it cannot be applied" on LOG()
expression.

If I use

LOG "x=%d,y=%d" x y;

then the release version surprisingly works, but the debug one gives

"Parse error: currified constructor"

How to overcome this? Another question: is there an up-to-date Camlp4
manual with all standard extensions (like pa_macro) properly documented?

- Dmitry Bely


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

end of thread, other threads:[~2005-09-08 12:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-06  8:07 camlp4 pa_macro Dmitry Bely
2005-09-06 19:35 ` [Caml-list] camlp4 pa_macro (doc request) Martin Jambon
2005-09-06 21:55   ` Remi Vanicat
2005-09-07  8:29     ` [Caml-list] camlp4 pa_macro Dmitry Bely
2005-09-07  8:40       ` Remi Vanicat
2005-09-07 12:03 ` Peter Jolly
2005-09-07 12:28   ` Basile STARYNKEVITCH
2005-09-07 19:46     ` Jonathan Roewen
2005-09-08  8:47   ` Dmitry Bely
2005-09-08 12:48     ` David MENTRE

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).