caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Brian Sniffen <brian.sniffen@gmail.com>
To: Oliver Bandel <oliver@first.in-berlin.de>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] local Open
Date: Tue, 25 Jan 2005 13:37:39 -0500	[thread overview]
Message-ID: <b624a1200501251037636799d@mail.gmail.com> (raw)
In-Reply-To: <20050125132740.GA321@first.in-berlin.de>

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
functor.

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
http://www.evenmere.org/~bts


  reply	other threads:[~2005-01-25 18:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-25 13:27 Oliver Bandel
2005-01-25 18:37 ` Brian Sniffen [this message]
2005-01-26 10:58 ` [Caml-list] " Julien Signoles

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b624a1200501251037636799d@mail.gmail.com \
    --to=brian.sniffen@gmail.com \
    --cc=bts@alum.mit.edu \
    --cc=caml-list@yquem.inria.fr \
    --cc=oliver@first.in-berlin.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).