* Which camlp variant?
@ 2007-11-07 18:25 tmp123
2007-11-07 18:20 ` [Caml-list] " Martin Jambon
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: tmp123 @ 2007-11-07 18:25 UTC (permalink / raw)
To: caml-list
Hello,
The module "pa_log" proposed by Mr. Conway seems very near to the
objective of my previuos post.
The objective now is expand a line like: DEBUG 3 "%d\n" 14
to: if debug.val then logint 3 ( fun () -> Printf.printf "%d\" 14 )
else ();
However, it is necessary to migrate the module to new camlpx .
Please, could someone give any advice about the current options: camlp4
or camlp5? PreCast? Functorial?
Thanks a lot.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] Which camlp variant?
2007-11-07 18:25 Which camlp variant? tmp123
@ 2007-11-07 18:20 ` Martin Jambon
2007-11-08 0:24 ` Nicolas Pouillard
2007-11-08 0:48 ` Christopher L Conway
2 siblings, 0 replies; 5+ messages in thread
From: Martin Jambon @ 2007-11-07 18:20 UTC (permalink / raw)
To: tmp123; +Cc: caml-list
On Wed, 7 Nov 2007, tmp123 wrote:
> Hello,
>
> The module "pa_log" proposed by Mr. Conway seems very near to the objective
> of my previuos post.
>
> The objective now is expand a line like: DEBUG 3 "%d\n" 14
> to: if debug.val then logint 3 ( fun () -> Printf.printf "%d\" 14 ) else ();
>
> However, it is necessary to migrate the module to new camlpx .
>
> Please, could someone give any advice about the current options: camlp4 or
> camlp5? PreCast? Functorial?
sed?
:-)
Martin
--
http://wink.com/profile/mjambon
http://martin.jambon.free.fr
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] Which camlp variant?
2007-11-07 18:25 Which camlp variant? tmp123
2007-11-07 18:20 ` [Caml-list] " Martin Jambon
@ 2007-11-08 0:24 ` Nicolas Pouillard
2007-11-08 0:48 ` Christopher L Conway
2 siblings, 0 replies; 5+ messages in thread
From: Nicolas Pouillard @ 2007-11-08 0:24 UTC (permalink / raw)
To: tmp123; +Cc: caml-list
Excerpts from tmp123's message of Wed Nov 07 19:25:59 +0100 2007:
> Hello,
>
> The module "pa_log" proposed by Mr. Conway seems very near to the
> objective of my previuos post.
>
> The objective now is expand a line like: DEBUG 3 "%d\n" 14
> to: if debug.val then logint 3 ( fun () -> Printf.printf "%d\" 14 )
> else ();
>
> However, it is necessary to migrate the module to new camlpx .
>
> Please, could someone give any advice about the current options: camlp4
> or camlp5? PreCast? Functorial?
I would recommend camlp4+PreCast because it's easier.
However camlp4 already have a builtin module very similar (called Camlp4DebugParser).
Here is a brief introduction...
(*
* No debugging code at all:
* $ camlp4o -parser Camlp4DebugParser debug_extension.ml
* true
* Debugging code for lexing:
* $ STATIC_CAMLP4_DEBUG='lexing' camlp4o -parser Camlp4DebugParser debug_extension.ml
* let () =
* if Camlp4.Debug.mode "lexing"
* then Debug.printf "lexing" "TOKEN: Int %d" (2 * 21)
* else ()
* in true
*
* Debugging code for lexing and parsing:
* $ STATIC_CAMLP4_DEBUG='lexing:parsing' camlp4o -parser Camlp4DebugParser debug_extension.ml
* let () =
* if Camlp4.Debug.mode "lexing"
* then Debug.printf "lexing" "TOKEN: Int %d" (2 * 21)
* else () in
* let () =
* if Camlp4.Debug.mode "parsing"
* then Debug.printf "parsing" "RULE: ..."
* else ()
* in true
*
* Debugging code for any section:
* $ STATIC_CAMLP4_DEBUG='*' camlp4o -parser Camlp4DebugParser debug_extension.ml
* ... same output as above ...
*
* When you program is compiled you can use the CAMLP4_DEBUG variable to
* activate some debugging sections.
*
* CAMLP4_DEBUG_FILE manage where messages goes (default is stderr).
*)
camlp4_debug lexing "TOKEN: Int %d" (2 * 21) in
camlp4_debug parsing "RULE: ..." in
true
--
Nicolas Pouillard aka Ertai
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] Which camlp variant?
2007-11-07 18:25 Which camlp variant? tmp123
2007-11-07 18:20 ` [Caml-list] " Martin Jambon
2007-11-08 0:24 ` Nicolas Pouillard
@ 2007-11-08 0:48 ` Christopher L Conway
[not found] ` <4a051d930711071716n7c88dde9t7dfe4c190ea3a90d@mail.gmail.com>
2 siblings, 1 reply; 5+ messages in thread
From: Christopher L Conway @ 2007-11-08 0:48 UTC (permalink / raw)
To: tmp123; +Cc: caml-list
pa_log is compatible with camlp5. In fact, that's what I use. Just
s/4/5/ all commands invoking camlp4.
Regards
Chris
On Nov 7, 2007 1:25 PM, tmp123 <tmp123@menta.net> wrote:
> Hello,
>
> The module "pa_log" proposed by Mr. Conway seems very near to the
> objective of my previuos post.
>
> The objective now is expand a line like: DEBUG 3 "%d\n" 14
> to: if debug.val then logint 3 ( fun () -> Printf.printf "%d\" 14 )
> else ();
>
> However, it is necessary to migrate the module to new camlpx .
>
> Please, could someone give any advice about the current options: camlp4
> or camlp5? PreCast? Functorial?
>
> Thanks a lot.
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-11-09 10:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-07 18:25 Which camlp variant? tmp123
2007-11-07 18:20 ` [Caml-list] " Martin Jambon
2007-11-08 0:24 ` Nicolas Pouillard
2007-11-08 0:48 ` Christopher L Conway
[not found] ` <4a051d930711071716n7c88dde9t7dfe4c190ea3a90d@mail.gmail.com>
2007-11-09 11:34 ` tmp123
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox