caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Local "open", or open locally
@ 2005-08-01  1:47 Lukasz Stafiniak
  2005-08-01  8:42 ` [Caml-list] " Richard Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Lukasz Stafiniak @ 2005-08-01  1:47 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-08-01 23:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-01  1:47 Local "open", or open locally Lukasz Stafiniak
2005-08-01  8:42 ` [Caml-list] " Richard Jones
2005-08-01 23:35   ` Lukasz Stafiniak

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