From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id CF5ADBC48 for ; Tue, 15 Mar 2005 03:13:54 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j2F2Ds6n020772 for ; Tue, 15 Mar 2005 03:13:54 +0100 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 DAA23846 for ; Tue, 15 Mar 2005 03:13:53 +0100 (MET) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j2F2DpGE015651 for ; Tue, 15 Mar 2005 03:13:52 +0100 Received: from localhost (suiren [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.13.1/8.13.1) with ESMTP id j2F2Djxf021651; Tue, 15 Mar 2005 11:13:46 +0900 (JST) Date: Tue, 15 Mar 2005 11:13:39 +0900 (JST) Message-Id: <20050315.111339.88500970.garrigue@math.nagoya-u.ac.jp> To: rich@annexia.org Cc: caml-list@inria.fr Subject: Re: [Caml-list] immutable Strings? From: Jacques Garrigue In-Reply-To: <20050314130148.GA19240@furbychan.cocan.org> References: <423567E1.1030909@sophia.inria.fr> <20050314125728.GA17687@furbychan.cocan.org> <20050314130148.GA19240@furbychan.cocan.org> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 423644E2.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 423644DF.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 naming:01 'open:01 syntax:01 submodule:01 ambiguities:01 syntax:01 compiler:01 bug:01 ...:98 ...:98 wrote:01 strings:01 workaround:01 immutable:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: From: Richard Jones > On Mon, Mar 14, 2005 at 12:57:28PM +0000, rich wrote: > > You can get the s.[i] shortcut by naming your module > > 'ImmString.String' (using a nested module in other words) and using > > 'open ImmString'. [...] > > (Replying to my own email ...) > > This reminds me of another problem I was going to ask about. Would it > be possible to have a syntax allowing you to always get to the "top" > of the module namespace. It could be something like ".String.copy" > which would always refer to the real String module, not to any > submodule of an opened module. First remark, there is a workaround against name hiding through open: you can bind your original module with another name before doing open. module OrigString = String open ImmString ... Not to say that the feature you suggest would be useless: there are cases where you want to avoid ambiguities. But the above syntax wouldn't work: in many cases the leading dot would be confused for a selection construct. Except for the syntax, I believe the implementation would be easy: the original environment is always kept around in the compiler. If you have a better idea for the syntax, register a wish with the bug report system... Jacques Garrigue