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 QAA32627; Tue, 11 Sep 2001 16:29:46 +0200 (MET DST) 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 QAA00052 for ; Tue, 11 Sep 2001 16:29:45 +0200 (MET DST) Received: from shell5.ba.best.com (shell5.ba.best.com [206.184.139.136]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f8BETi113503 for ; Tue, 11 Sep 2001 16:29:44 +0200 (MET DST) Received: from localhost (bpr@localhost) by shell5.ba.best.com (8.9.3/8.9.2/best.sh) with ESMTP id HAA20322; Tue, 11 Sep 2001 07:28:23 -0700 (PDT) Date: Tue, 11 Sep 2001 07:28:23 -0700 (PDT) From: Brian Rogoff To: Sven cc: Andreas Rossberg , Subject: Re: [Caml-list] Style question In-Reply-To: <20010911141602.A30234@dpt-info.u-strasbg.fr> Message-ID: <20010911072419.P13928-100000@shell5.ba.best.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 11 Sep 2001, Sven wrote: > On Tue, Sep 11, 2001 at 02:08:32PM +0200, Andreas Rossberg wrote: > > Sven wrote: > > > > > > > local open M in > > > > ... > > > > end > > > > > > > > Of course, in OCaml this is solved by having open vs. include. > > > > > > Also, would not : > > > > > > let module = struct ... end in > > > > > > be another solution for it, maybe in conjunction with the open syntax ? > > > > Not sure, since I don't understand your code snippet, or how it is > > related to local or open. Could you clarify a bit? let module = struct open M ... let f = ... end in f ... This pretty much gives you local open, with very little verbosity. I don't even think the sugar is needed. > Well, consider : > > let module M = struct let f x = x * x end in M.f 5 ;; > > Sure, you still have to access f trough M., but you could imagine something > with the open/include directive. Not sure if it is possible already to do a > local open, but i think it was already discussed in the past. Consider : The solution is just to do the open in the local module, and everything in the scope of that module can use opened identifiers. -- Brian ------------------- 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