From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA13327 for caml-redistribution; Wed, 28 Oct 1998 13:11:40 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA07712 for ; Tue, 27 Oct 1998 21:36:11 +0100 (MET) Received: from deneb.fac.cs.cmu.edu (DENEB.FAC.CS.CMU.EDU [128.2.198.60]) by nez-perce.inria.fr (8.8.7/8.8.7) with SMTP id VAA10013 for ; Tue, 27 Oct 1998 21:36:08 +0100 (MET) Received: from NAIAD.FAC.CS.CMU.EDU by deneb.fac.cs.cmu.edu id aa23105; 27 Oct 98 15:35 EST Date: Tue, 27 Oct 1998 15:35:35 -0500 (EST) From: John Prevost Sender: weis To: caml-list@inria.fr Subject: Local opening of modules Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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