caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Local opening of modules
@ 1998-10-27 20:35 John Prevost
  1998-11-10 16:04 ` Anton Moscal
  0 siblings, 1 reply; 7+ messages in thread
From: John Prevost @ 1998-10-27 20:35 UTC (permalink / raw)
  To: caml-list

This is a question that I found asked back in the logs, but which I
found no answer to:

Is there any good reason that Caml doesn't have a mechanism like SML's
to open a module locally?  For example:

let open Num in
let a = num_of_int 2739 in
let b = num_of_int 234 in
let bar = a +/ b;;

an even better example would be one in which the symbol "+/" was
actually "+", like in the SML bignum package.  A friend of mine used
this mechanism quite well in a project where bignum math was used in
only a few restricted places.  The rest of the file didn't need to be
polluted namespace-wise with the bignum package (and if there were, say,
another package that wanted +/ it wouldn't cause problems...  There are
only so many reasonable versions of + you can make without getting into
collision problems, after all.)

Maybe there's a technical constraint in the way Caml is organized that
keeps this from being done?

jmp





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

end of thread, other threads:[~1998-11-30 18:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-10-27 20:35 Local opening of modules John Prevost
1998-11-10 16:04 ` Anton Moscal
1998-11-10 21:22   ` John Prevost
1998-11-25 15:17     ` Objects as sums Anton Moscal
1998-11-26 15:58       ` Didier Remy
1998-11-28 10:46         ` Anton Moscal
1998-11-30 12:35           ` Jerome Vouillon

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