English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
local Open
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-01-25 (18:37)
From: Brian Sniffen <brian.sniffen@g...>
Subject: Re: [Caml-list] local Open
On Tue, 25 Jan 2005 14:27:40 +0100, Oliver Bandel
<oliver@first.in-berlin.de> wrote:
> is it planned to have a local Open-statement in OCaml
> in newer Versions?

There is no local open because open is entirely syntactic.  What you
can do to simulate a local open is this: wrap your code in a module
which is a functor.  Provide as arguments the modules you wish to
"locally open".  Then you can write in those terms inside your

Also, be aware that "open" is only scoped to that file in which it
occurs, and you can acheive similar effects with less writing by
splitting your code into separate files.

Brian T. Sniffen
bts@alum.mit.edu    or    brian.sniffen@gmail.com