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 QAA32510; Tue, 11 Sep 2001 16:29:34 +0200 (MET DST) 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 QAA32721 for ; Tue, 11 Sep 2001 16:29:33 +0200 (MET DST) Received: from uni-sb.de (uni-sb.de [134.96.252.33]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f8BETWL03755 for ; Tue, 11 Sep 2001 16:29:32 +0200 (MET DST) Received: from cs.uni-sb.de (cs.uni-sb.de [134.96.252.31]) by uni-sb.de (8.11.6/2001082200) with ESMTP id f8BETWP14434; Tue, 11 Sep 2001 16:29:32 +0200 (CEST) Received: from mail.cs.uni-sb.de (IDENT:JHJLKK1BjopWToijwbOWZS7Wck08YSuu@mail.cs.uni-sb.de [134.96.254.200]) by cs.uni-sb.de (8.11.6/2001081600) with ESMTP id f8BETVd21317; Tue, 11 Sep 2001 16:29:31 +0200 (CEST) Received: from ps.uni-sb.de (grizzly.ps.uni-sb.de [134.96.186.68]) by mail.cs.uni-sb.de (8.11.6/2001082200) with ESMTP id f8BETTo11798; Tue, 11 Sep 2001 16:29:29 +0200 (CEST) X-Authentication-Warning: email: Host grizzly.ps.uni-sb.de [134.96.186.68] claimed to be ps.uni-sb.de Received: from ps.uni-sb.de (zoidberg.ps.uni-sb.de [134.96.186.121]) by ps.uni-sb.de (8.11.2/8.11.0) with ESMTP id f8BETSt05821; Tue, 11 Sep 2001 16:29:28 +0200 Message-ID: <3B9E1FC8.605D057A@ps.uni-sb.de> Date: Tue, 11 Sep 2001 16:29:28 +0200 From: Andreas Rossberg Organization: =?iso-8859-1?Q?Universit=E4t?= des Saarlandes X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.3-12 i686) X-Accept-Language: de, en MIME-Version: 1.0 To: Sven CC: caml-list@inria.fr Subject: Re: [Caml-list] Style question References: <20010909132144.X7348-100000@shell5.ba.best.com> <3B9DE076.568458F9@ps.uni-sb.de> <20010911125524.B29665@dpt-info.u-strasbg.fr> <3B9DFEC0.2D7BCAEA@ps.uni-sb.de> <20010911141602.A30234@dpt-info.u-strasbg.fr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Sven wrote: > > > Not sure, since I don't understand your code snippet, or how it is > > related to local or open. Could you clarify a bit? > > 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. I suspect you are mixing up issues. Brian asked what the best OCaml translation of SML's "local" construct would be. In SML "local" allows to limit the scope of declarations. Unlike "let", its body is not an expression but again a sequence of declarations, so that the whole construct is a declaration. I argued that the one of the few real uses of that construct is to restrict the scope of an "open" declaration in SML. So we were not discussing how to encode something like "let open M in exp" in OCaml (although that also might be an issue when translating SML to OCaml). That is relatively easy with "let module" and has been discussed here before, IIRC: let module Aux = struct open M val body = exp end in Aux.body Was that what you were aiming at? - Andreas -- Andreas Rossberg, rossberg@ps.uni-sb.de "Computer games don't affect kids; I mean if Pac Man affected us as kids, we would all be running around in darkened rooms, munching magic pills, and listening to repetitive electronic music." - Kristian Wilson, Nintendo Inc. ------------------- 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