From: Basile STARYNKEVITCH <basile@starynkevitch.net>
To: Peter Jolly <peter@jollys.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] camlp4 pa_macro
Date: Wed, 7 Sep 2005 14:28:34 +0200 [thread overview]
Message-ID: <20050907122834.GA8107@ours.starynkevitch.net> (raw)
In-Reply-To: <431ED6FB.9010009@jollys.org>
Le Wed, Sep 07, 2005 at 01:03:07PM +0100, Peter Jolly écrivait/wrote:
> Dmitry Bely wrote:
> > 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.
>
For information the pa_trace.ml file (for camlp4 for a pre 3.08
version of ocaml) did exactly what you want to achieve
you might look for POESIA on sourceforge at
http://sourceforge.net/project/showfiles.php?group_id=79887&release_id=1
download the source package http://prdownloads.sourceforge.net/poesia/poesiasoft_snapshot_20july2005.tar.gz?download
and look for the pa_trace.ml inside PoesiaMonIcap
this is orphaned software (GPL). I don't maintain it anymore, and I
believe it don't compile as-is on 3.08 because of the location change
in camlp4 since 3.06. Feel free to patch it for your needs.
Regards
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile(at)starynkevitch(dot)net
8, rue de la Faïencerie, 92340 Bourg La Reine, France
next prev parent reply other threads:[~2005-09-07 12:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-06 8:07 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 [this message]
2005-09-07 19:46 ` Jonathan Roewen
2005-09-08 8:47 ` Dmitry Bely
2005-09-08 12:48 ` David MENTRE
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050907122834.GA8107@ours.starynkevitch.net \
--to=basile@starynkevitch.net \
--cc=caml-list@inria.fr \
--cc=peter@jollys.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox