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 XAA19269; Fri, 10 Jan 2003 23:36:07 +0100 (MET) 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 XAA19263 for ; Fri, 10 Jan 2003 23:36:06 +0100 (MET) Received: from venus.is.s.u-tokyo.ac.jp (venus.is.s.u-tokyo.ac.jp [133.11.12.9]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h0AMa4501413 for ; Fri, 10 Jan 2003 23:36:04 +0100 (MET) Received: from tuba.is.s.u-tokyo.ac.jp (tuba.is.s.u-tokyo.ac.jp [133.11.12.102]) by venus.is.s.u-tokyo.ac.jp (8.11.6/3.7W) with ESMTP id h0AMZxv13906; Sat, 11 Jan 2003 07:35:59 +0900 (JST) Received: (from oiwa@localhost) by tuba.is.s.u-tokyo.ac.jp (8.11.6+Sun/3.7W) id h0AMZxG26710; Sat, 11 Jan 2003 07:35:59 +0900 (JST) X-Authentication-Warning: tuba.is.s.u-tokyo.ac.jp: oiwa set sender to oiwa@yl.is.s.u-tokyo.ac.jp using -f To: jehenrik Cc: caml-list@inria.fr Subject: Re: [Caml-list] camlp4: ONCE construct References: From: Yutaka OIWA Date: 11 Jan 2003 07:35:59 +0900 In-Reply-To: jehenrik's message of "Fri, 10 Jan 2003 14:14:14 -0500" Message-ID: User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >> On Fri, 10 Jan 2003 14:14:14 -0500, jehenrik said: 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 See an article by Francois Pottier at http://caml.inria.fr/archives/200107/msg00187.html for (almost direct) answer. Here is my question: Is there any way to declare a module-local variable without using .mli signature? It may not be prefarable for direct use by OCaml programmers (than signature approach), but is useful for camlp4 programmers to avoid name crashes caused by "open" or "include" directive. P.S. I have implemented a more powerful syntax extension for regular expression matching, and I'm now preparing a documentation. I'll release it for caml-list within this month (hopefully). -- Yutaka Oiwa Yonezawa Lab., Dept. of Computer Science, Graduate School of Information Sci. & Tech., Univ. of Tokyo. , PGP fingerprint = C9 8D 5C B8 86 ED D8 07 EA 59 34 D8 F4 65 53 61 ------------------- 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