caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Camlp4: varargs ie a la Printf
Date: Tue, 18 Jun 2002 08:27:35 +0200	[thread overview]
Message-ID: <20020618082735.G11335@verdot.inria.fr> (raw)
In-Reply-To: <15629.62581.329369.773250@is002254.saclay.cea.fr>; from basile.starynkevitch@cea.fr on Mon, Jun 17, 2002 at 04:38:45PM +0200

Hi,

On Mon, Jun 17, 2002 at 04:38:45PM +0200, Basile STARYNKEVITCH wrote:

>   Pcaml.expr: LEVEL "top" 
>   [ [ "trace" ; trid = UIDENT ; fmt = STRING ; args = LIST0 Pcaml.expr ; "end" ->
>     let lctrid = String.lowercase trid in 
> [...]
> 	(Printf.sprintf $str:fmt$ 
> 	 (**** WHAT SHOULD BE ADDED HERE? *****)

John Malecki answered correcly (how to create an AST of a list), but
I would just add that "args = LIST0 Pcaml.expr" does not work without
separator, because if you have "a b c" on input, it does not return
the list of a, b and c, but the application of the function a to b and
c.

A solution is to call Pcaml.expr at the level just after the application,
i.e. for the normal and revised syntaxes: ".":
        args = LIST0 (Pcaml.expr LEVEL ".)

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


      parent reply	other threads:[~2002-06-18  6:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-17 14:38 Basile STARYNKEVITCH
2002-06-17 14:59 ` Alain Frisch
2002-06-17 16:20   ` John Malecki
2002-06-18  6:27 ` Daniel de Rauglaudre [this message]

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=20020618082735.G11335@verdot.inria.fr \
    --to=daniel.de_rauglaudre@inria.fr \
    --cc=caml-list@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).