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] [Q] camlp4 help (fwd)
Date: Sat, 6 Oct 2001 12:30:44 +0200	[thread overview]
Message-ID: <20011006123044.D2327@verdot.inria.fr> (raw)
In-Reply-To: <Pine.LNX.4.21.0110060129200.6840-100000@genghis>; from jd@psoftware.net on Sat, Oct 06, 2001 at 01:29:29AM -0400

Hi,

On Sat, Oct 06, 2001 at 01:29:29AM -0400, jd marrow wrote:

> (1) declare a value named ident0 in the current module, and
> (2) wrap subsequent functional values matching those described in the
>     identifier list with special code...
> can you point me to any camlp4 code that does something which is [even
> remotely] similar?

This is possible. You have to extend the entry Pcaml.str_item
(structure item) with your grammar rule. Both syntaxes ("foo" or
"let foo" should work).

If I undertand your problem well, you want to generate *several* items
from *one* item? For that, you can use the "declare" statement of the
abstract syntax tree.  Your semantic action could be something like:
     let x = ... build your structure items list ...
     <:str_item< declare $list:x$ end >>

If you want more details or if you need more explanations or some help
to write your code, feel free to ask me.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


      reply	other threads:[~2001-10-06 10:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-06  5:29 jd marrow
2001-10-06 10:30 ` 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=20011006123044.D2327@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).