Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
camlp4 pa_macro
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-09-06 (08:03)
From: Dmitry Bely <dbely@m...>
Subject: camlp4 pa_macro
Is it possible to achieve with pa_macro something like this:

DEFINE LOG(expr) = ()
DEFINE LOG(expr) = Printf.printf expr
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()

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