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 CAA21958; Sat, 11 Jan 2003 02:23:14 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA21998 for ; Sat, 11 Jan 2003 02:23:13 +0100 (MET) Received: from c007.snv.cp.net (h013.c007.snv.cp.net [209.228.33.241]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id h0B1NC504251 for ; Sat, 11 Jan 2003 02:23:12 +0100 (MET) Received: (cpmta 5247 invoked from network); 10 Jan 2003 17:23:10 -0800 Received: from 65.187.194.217 (HELO localhost) by smtp.directvinternet.com (209.228.33.241) with SMTP; 10 Jan 2003 17:23:10 -0800 X-Sent: 11 Jan 2003 01:23:10 GMT Date: Fri, 10 Jan 2003 20:23:16 -0500 Subject: Re: [Caml-list] camlp4: ONCE construct Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v482) Cc: caml-list@inria.fr To: Yutaka OIWA From: jehenrik In-Reply-To: Message-Id: <42D8BD95-2503-11D7-B29E-00039375801A@yahoo.com> Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.482) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > See an article by Francois Pottier at > http://caml.inria.fr/archives/200107/msg00187.html > for (almost direct) answer. Well, for my original question, consider the choice of regular expression compilation to be an arbitrary task. The only point is that it be computationally expensive. I have wanted the same thing in completely different contexts. Jeff Henrikson jehenrik> Hi, jehenrik> I would like to write a Camlp4 construct which causes its argument to jehenrik> only be evaluated once. Eg: jehenrik> ... jehenrik> ... jehenrik> ... jehenrik> ONCE Pcre.regexp "([0-9]+)" jehenrik> would be transformed to: jehenrik> let gensym000 = Pcre.regexp "([0-9]+)";; jehenrik> ... jehenrik> ... jehenrik> ... jehenrik> gensym000 ------------------- 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