<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2005/05/37b42687d04995fbcb5062ee307bedae"
  from="Andreas Rossberg &lt;rossberg@p...&gt;"
  author="Andreas Rossberg"
  date="2005-05-11T17:12:04"
  subject="Re: [Caml-list] Renaming structures during inclusions?"
  prev="2005/05/7ee13064bc1230e05568f0365c62440b"
  next="2005/05/044060475aa4fbf6c9f1d9f9e4e03e1a"
  prev-in-thread="2005/05/7ee13064bc1230e05568f0365c62440b"
  next-in-thread="2005/05/3abc8201379e2ef20e8b76b1b198d8aa"
  prev-thread="2005/05/673536cfea964e1a6113b5a44033866d"
  next-thread="2005/05/428d4fa76763d222dd5a06d729908ab9"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Renaming structures during inclusions?">
<msg 
  url="2005/05/4d2ef87a667ec8c5e2fc34351c0bf627"
  from="Markus Mottl &lt;markus.mottl@g...&gt;"
  author="Markus Mottl"
  date="2005-05-11T15:44:17"
  subject="Renaming structures during inclusions?">
<msg 
  url="2005/05/7ee13064bc1230e05568f0365c62440b"
  from="Christophe TROESTLER &lt;debian00@t...&gt;"
  author="Christophe TROESTLER"
  date="2005-05-11T16:33:34"
  subject="Re: [Caml-list] Renaming structures during inclusions?">
<msg 
  url="2005/05/37b42687d04995fbcb5062ee307bedae"
  from="Andreas Rossberg &lt;rossberg@p...&gt;"
  author="Andreas Rossberg"
  date="2005-05-11T17:12:04"
  subject="Re: [Caml-list] Renaming structures during inclusions?">
<msg 
  url="2005/05/3abc8201379e2ef20e8b76b1b198d8aa"
  from="Markus Mottl &lt;markus.mottl@g...&gt;"
  author="Markus Mottl"
  date="2005-05-11T18:02:39"
  subject="Re: [Caml-list] Renaming structures during inclusions?">
<msg 
  url="2005/05/0d29d4a050051c575f2b0806b9409976"
  from="Andreas Rossberg &lt;rossberg@p...&gt;"
  author="Andreas Rossberg"
  date="2005-05-12T14:24:54"
  subject="Re: [Caml-list] Renaming structures during inclusions?">
</msg>
</msg>
<msg 
  url="2005/05/32852c0e9441fd5cacc1b63046dc78af"
  from="Christophe TROESTLER &lt;debian00@t...&gt;"
  author="Christophe TROESTLER"
  date="2005-05-11T18:16:32"
  subject="Re: [Caml-list] Renaming structures during inclusions?">
</msg>
</msg>
</msg>
<msg 
  url="2005/05/13030773278c40d6367360759638756e"
  from="Jacques Garrigue &lt;garrigue@m...&gt;"
  author="Jacques Garrigue"
  date="2005-05-12T01:25:05"
  subject="Re: [Caml-list] Renaming structures during inclusions?">
<msg 
  url="2005/05/f21910b0fdba032abfe6aae9cf36141e"
  from="Markus Mottl &lt;markus.mottl@g...&gt;"
  author="Markus Mottl"
  date="2005-05-12T17:10:01"
  subject="[Caml-list] Renaming structures during inclusions?">
</msg>
</msg>
<msg 
  url="2005/05/f8b848426e6b4dc35e7b225e865f69ff"
  from="Norman Ramsey &lt;nr@e...&gt;"
  author="Norman Ramsey"
  date="2005-05-12T15:26:35"
  subject="Re: [Caml-list] Renaming structures during inclusions? ">
</msg>
<msg 
  url="2005/05/7982251841eb7d842da9dfde066e3729"
  from="Aleksey Nogin &lt;nogin@c...&gt;"
  author="Aleksey Nogin"
  date="2005-05-12T20:02:20"
  subject="Re: [Caml-list] Renaming structures during inclusions?">
</msg>
</msg>
</thread>

<contents>
Christophe TROESTLER wrote:
&gt; 
&gt; Wouldn't it be better to have a compiler switch (say "-w T/t", off by
&gt; default) to overide that behavior (new definitions override old ones
&gt; as with [open])?  Of course that makes it impossible to write M1
&gt; signature without aliasing [t] and [Std] but IMHO that's fine.

Note that OCaml's type system fundamentally relies on the fact that type 
names cannot be shadowed in structures.

&gt; This
&gt; way, no new syntax needs to be introduced (and one is not forced to
&gt; alias modules one does not care about -- e.g. utilities).
&gt; 
&gt; module M = struct
&gt;   include M1
&gt;   type m1_t = M1.t
&gt;   module M1Std = M1.Std
&gt; 
&gt;   include M2
&gt;   type m2_t = M2.t
&gt;   module M2Std = M2.Std
&gt; 
&gt;   module Std = struct
&gt;     include M1.Std
&gt;     include M2.Std
&gt;   end
&gt; end

While your proposal probably could be made to work in this particular 
case - 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, likewise 
for the other elements - 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).

Cheers,

   - Andreas

-- 
Andreas Rossberg, rossberg@ps.uni-sb.de

Let's get rid of those possible thingies!  -- TB

</contents>

</message>

