caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Lukasz Stafiniak <lukstafi@gmail.com>
To: caml-list@yquem.inria.fr
Subject: Local "open", or open locally
Date: Mon, 1 Aug 2005 03:47:43 +0200	[thread overview]
Message-ID: <4a708d20507311847380538ae@mail.gmail.com> (raw)

Dear list,

What about a construct for opening modules locally in an expression? For example

module SomeModule = struct let x = 5 end
module SomeOtherModule = struct let y = 7 end

let z = open SomeModule and SomeOtherModule in x + y + x*y

It can currently be expressed as:

let z = module XY = struct open SomeModule open SomeOtherModule
  let z = x + y + x*y end in XY.z

Perhaps it could be considered as a language extension. It seems nice
as it "catches the focus". (I'm going to use it with Camlp4 but it
seems uglier that way.)

I wouldn't buy it for my kidney, though. ;)

Best Regards,
Lukasz Stafiniak


             reply	other threads:[~2005-08-01  1:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-01  1:47 Lukasz Stafiniak [this message]
2005-08-01  8:42 ` [Caml-list] " Richard Jones
2005-08-01 23:35   ` Lukasz Stafiniak

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=4a708d20507311847380538ae@mail.gmail.com \
    --to=lukstafi@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    /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).