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 KAA04880; Wed, 3 Jul 2002 10:08:10 +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 KAA04846 for ; Wed, 3 Jul 2002 10:08:10 +0200 (MET DST) 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 g63889912385 for ; Wed, 3 Jul 2002 10:08:09 +0200 (MET DST) Received: (from ddr@localhost) by verdot.inria.fr (8.9.3/8.9.3) id KAA23765 for caml-list@inria.fr; Wed, 3 Jul 2002 10:08:09 +0200 Date: Wed, 3 Jul 2002 10:08:09 +0200 From: Daniel de Rauglaudre To: caml-list@inria.fr Subject: Re: [Caml-list] camlp4 and anonymous function naming Message-ID: <20020703100809.D23414@verdot.inria.fr> References: <20020702.115619.74735853.avv@quasar.ipa.nw.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from farago@eecs.harvard.edu on Tue, Jul 02, 2002 at 04:48:22PM -0400 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, On Tue, Jul 02, 2002 at 04:48:22PM -0400, Julie Farago wrote: > let givenames loc vars e = > let name = namefun "my" in > <:expr< > let $lid:name$ $vars$ = $e$ > in $lid:name$ >> > > This code is, of course, wrong. The problem is that I cannot figure out > how to simply capture the args from the fun and place them back into the > let. Write this function like this: let givenames loc vars e = let name = namefun "my" in let e = List.fold_right (fun p e -> <:expr< fun $lid:p$ -> $e$ >>) vars e in <:expr< let $lid:name$ = $e$ in $lid:name$ >> -- 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