caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: rich@annexia.org
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] immutable Strings?
Date: Tue, 15 Mar 2005 11:13:39 +0900 (JST)	[thread overview]
Message-ID: <20050315.111339.88500970.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <20050314130148.GA19240@furbychan.cocan.org>

From: Richard Jones <rich@annexia.org>
> 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


  reply	other threads:[~2005-03-15  2:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-12 20:50 Oliver Bandel
2005-03-14 10:30 ` [Caml-list] " Pascal Zimmer
2005-03-14 10:41   ` Jon Harrop
2005-03-14 11:15     ` Pascal Zimmer
2005-03-14 12:57   ` Richard Jones
2005-03-14 13:01     ` Richard Jones
2005-03-15  2:13       ` Jacques Garrigue [this message]
2005-03-15  8:09         ` Oliver Bandel
2005-03-15  8:40     ` Oliver Bandel

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=20050315.111339.88500970.garrigue@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=rich@annexia.org \
    /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).