From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA28181; Sat, 6 Oct 2001 12:30:50 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA28206 for ; Sat, 6 Oct 2001 12:30:49 +0200 (MET DST) Received: from verdot.inria.fr (verdot.inria.fr [128.93.11.7]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f96AUnX20529 for ; Sat, 6 Oct 2001 12:30:49 +0200 (MET DST) Received: (from ddr@localhost) by verdot.inria.fr (8.9.3/8.9.3) id MAA02761 for caml-list@inria.fr; Sat, 6 Oct 2001 12:30:44 +0200 Date: Sat, 6 Oct 2001 12:30:44 +0200 From: Daniel de Rauglaudre To: caml-list@inria.fr Subject: Re: [Caml-list] [Q] camlp4 help (fwd) Message-ID: <20011006123044.D2327@verdot.inria.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from jd@psoftware.net on Sat, Oct 06, 2001 at 01:29:29AM -0400 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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