Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Jonathan Roewen <jonathan.roewen@g...>
Subject: Re: [Caml-list] camlp4 pa_macro
> > > IFDEF NDEBUG THEN
> > > DEFINE LOG(expr) = ()
> > > ELSE
> > > DEFINE LOG(expr) = Printf.printf expr
> > > ENDIF
> > > ...
> > > LOG("x=%d,y=%d" x y);

I don't see anything that says the DEFINEs have to be symmetric.

Maybe this doesn't handle parameters like I assume it would, but how about:

IFDEF NDEBUG THEN
DEFINE LOG(expr) = ()
ELSE
DEFINE LOG = Printf.printf
ENDIF

Jonathan