From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA25418 for caml-redistribution; Thu, 12 Nov 1998 08:57:04 +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 WAA21676 for ; Tue, 10 Nov 1998 22:25:04 +0100 (MET) Received: from deneb.fac.cs.cmu.edu (DENEB.FAC.CS.CMU.EDU [128.2.198.60]) by nez-perce.inria.fr (8.8.7/8.8.7) with SMTP id WAA08462 for ; Tue, 10 Nov 1998 22:25:01 +0100 (MET) Received: from NAIAD.FAC.CS.CMU.EDU by deneb.fac.cs.cmu.edu id aa27090; 10 Nov 98 16:22 EST Date: Tue, 10 Nov 1998 16:22:51 -0500 (EST) From: John Prevost Sender: weis To: Anton Moscal cc: caml-list@inria.fr Subject: Re: Local opening of modules In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 10 Nov 1998, Anton Moscal wrote: > With CamlP4 preprocessor (tool for syntax extension of Ocaml) I got > this effect by the following grammar extension: {...} Interesting. I hadn't realized that you could define modules inside let statements like this: let f x = let module M = struct open Foo;; let v = x + x end in M.v (which is exactly what you're doing...) Actually, the non-sugared form I've written above is pretty satisfactory all by itself, although not as clean looking as the sugared-up camlp4 stuff. Thanks! John.