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 CAA21711; Sun, 13 Jan 2002 02:41:51 +0100 (MET) 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 CAA22046 for ; Sun, 13 Jan 2002 02:41:50 +0100 (MET) Received: from verdot.inria.fr (verdot.inria.fr [128.93.11.7]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g0D1foP24734 for ; Sun, 13 Jan 2002 02:41:50 +0100 (MET) Received: (from ddr@localhost) by verdot.inria.fr (8.9.3/8.9.3) id CAA18057 for caml-list@inria.fr; Sun, 13 Jan 2002 02:41:49 +0100 Date: Sun, 13 Jan 2002 02:41:49 +0100 From: Daniel de Rauglaudre To: caml-list@inria.fr Subject: Re: [Caml-list] camlp4: generating keyword on the fly Message-ID: <20020113024149.A18030@verdot.inria.fr> References: <005201c19bd1$a72e8b00$0b01a8c0@mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <005201c19bd1$a72e8b00$0b01a8c0@mit.edu>; from jehenrik@yahoo.com on Sat, Jan 12, 2002 at 08:28:49PM -0500 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, On Sat, Jan 12, 2002 at 08:28:49PM -0500, Jeff Henrikson wrote: > I want to be able to cook up keywords on the fly using camlp4, and > it seems like I should be able to do it. I am not sure what "cook up" means in English, but if you want to give a string variable as keyword, write it between dollars in the EXTEND statement: let make_one_item_entry entrysym (keyword : string) = let tmp = (Grammar.Entry.create Pcaml.gram entrysym) in EXTEND tmp: [ [ $keyword$ ] ] ; END; tmp;; Grammar.Entry.print (make_one_item_entry "happy" "birthday");; This is an undocumented feature. -- 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