caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christophe TROESTLER <debian00@tiscali.be>
To: "O'Caml Mailing List" <caml-list@inria.fr>
Subject: Re: [Caml-list] Renaming structures during inclusions?
Date: Wed, 11 May 2005 20:16:23 +0200 (CEST)	[thread overview]
Message-ID: <20050511.201623.123148110.debian00@tiscali.be> (raw)
In-Reply-To: <42823CDF.3060109@ps.uni-sb.de>

On Wed, 11 May 2005, Andreas Rossberg <rossberg@ps.uni-sb.de> wrote:
> 
> Note that OCaml's type system fundamentally relies on the fact that
> type names cannot be shadowed in structures.

Yes, you are correct -- I was thinking of checking the sig against a
given one, not to generate it.

> the compiler had to figure out that it can break the dependency on
> the first t by reordering m1_t relative to the fields from M1 in the
> derived signature and substituting m1_t for t in these fields, [...]
> it is *far* from obvious if and how this can be inferred in general,
> particularly when your modules go higher-order.
> 
> I believe it would require something akin to join and meet operations on 
> signatures, but it is known that these don't exist for some very similar 
> systems (signatures for higher-order modules don't form a lattice).

The substitution in itself is nothing difficult, isn't it.  Or is it
because you need to "backtrack" to change the inferred sigs?  Is the
problem when to do it?  Do you have examples?  I do not immediately
see why a rule like "duplicate types/modules are forbidden in a sig
unless one of them is explicitely renamed" would be difficult to check[1].

On the other hand, one may also argue that Markus proposal is cleaner.

Regards,
ChriS


[1] E.g. -- the simpler -- when the shadowing occurs (this is already
detected), an alternative name for the type must be available.


  parent reply	other threads:[~2005-05-11 18:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-11 15:44 Markus Mottl
2005-05-11 16:33 ` [Caml-list] " Christophe TROESTLER
2005-05-11 17:11   ` Andreas Rossberg
2005-05-11 18:02     ` Markus Mottl
2005-05-12 14:24       ` Andreas Rossberg
2005-05-11 18:16     ` Christophe TROESTLER [this message]
2005-05-12  1:24 ` Jacques Garrigue
     [not found]   ` <f8560b80505120836681ab281@mail.gmail.com>
2005-05-12 17:09     ` Markus Mottl
2005-05-12 15:26 ` Norman Ramsey
2005-05-12 20:02 ` Aleksey Nogin

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=20050511.201623.123148110.debian00@tiscali.be \
    --to=debian00@tiscali.be \
    --cc=caml-list@inria.fr \
    /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).