<?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="2003/10/7e91616dcacffc47b139c28c440aa9e3"
  from="Andreas Rossberg &lt;rossberg@p...&gt;"
  author="Andreas Rossberg"
  date="2003-10-09T12:44:06"
  subject="Re: [Caml-list] Constructors as functions and tuples in constructors"
  prev="2003/10/47c7cdb43fae188992cfd97ecd09aa5c"
  next="2003/10/3792447d06a23adc7c7923b6498b30c2"
  prev-in-thread="2003/10/381db41c1fe9cbbdbe0afbb6f271d21e"
  next-in-thread="2003/10/7778131e9bb9dc8f0e37e810e13cd361"
  prev-thread="2003/10/e79513aa34d4347fb9f61c4d83c4e732"
  next-thread="2003/10/d04befa7beb24ef22b9d02a9066de8f7"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Constructors as functions and tuples in constructors">
<msg 
  url="2003/10/8e30e035c3408ed133428b3777754c4d"
  from="Serge &lt;serge@s...&gt;"
  author="Serge"
  date="2003-10-08T15:57:09"
  subject="[Caml-list] Constructors as functions and tuples in constructors">
<msg 
  url="2003/10/fe9eb2aaab78d81d8a7bbe3b3ba36dc7"
  from="Dan Grossman &lt;djg@c...&gt;"
  author="Dan Grossman"
  date="2003-10-08T16:07:33"
  subject="Re: [Caml-list] Constructors as functions and tuples in constructors">
<msg 
  url="2003/10/801b7b1b1823b88569425a89ac8c7458"
  from="Andreas Rossberg &lt;rossberg@p...&gt;"
  author="Andreas Rossberg"
  date="2003-10-08T16:49:13"
  subject="Re: [Caml-list] Constructors as functions and tuples in constructors">
<msg 
  url="2003/10/381db41c1fe9cbbdbe0afbb6f271d21e"
  from="Dan Grossman &lt;djg@c...&gt;"
  author="Dan Grossman"
  date="2003-10-08T17:04:56"
  subject="Re: [Caml-list] Constructors as functions and tuples in constructors">
<msg 
  url="2003/10/7e91616dcacffc47b139c28c440aa9e3"
  from="Andreas Rossberg &lt;rossberg@p...&gt;"
  author="Andreas Rossberg"
  date="2003-10-09T12:44:06"
  subject="Re: [Caml-list] Constructors as functions and tuples in constructors">
</msg>
</msg>
<msg 
  url="2003/10/7778131e9bb9dc8f0e37e810e13cd361"
  from="Alain.Frisch@e..."
  author="Alain.Frisch@e..."
  date="2003-10-08T18:28:21"
  subject="Re: [Caml-list] Constructors as functions and tuples in constructors">
<msg 
  url="2003/10/bfa15ffef4ce902d4ae1ce0139df5072"
  from="Marcin &apos;Qrczak&apos; Kowalczyk &lt;qrczak@k...&gt;"
  author="Marcin &apos;Qrczak&apos; Kowalczyk"
  date="2003-10-08T18:44:22"
  subject="Re: [Caml-list] Constructors as functions and tuples in constructors">
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/10/ee34acd3dffbe03f80f49fb59152a170"
  from="Michal Moskal &lt;malekith@p...&gt;"
  author="Michal Moskal"
  date="2003-10-08T16:15:10"
  subject="Re: [Caml-list] Constructors as functions and tuples in constructors">
</msg>
<msg 
  url="2003/10/897ac973c627b803ed112c8001b114a4"
  from="Nicolas Cannasse &lt;warplayer@f...&gt;"
  author="Nicolas Cannasse"
  date="2003-10-08T16:25:26"
  subject="Re: [Caml-list] Constructors as functions and tuples in constructors">
</msg>
</msg>
</thread>

<contents>
Dan Grossman wrote:
&gt; 
&gt; (1) A pattern-match would have the potential of allocating memory, which 
&gt; some may judge poorly.  But the compiler could warn about this.

Good point, but I don't think anybody would really care.

&gt; (2) This transformation does require the type A carries is transparent. 
&gt;  So we still couldn't relax the "other" restriction that a signature 
&gt; cannot hide an unparenthesized t1 * t2 variant.

Of course, no change there.

&gt; (3) It's not clear how far this trivial transformation should be 
&gt; generalized.  For example, given
&gt;   type t = A of int * int * int * int
&gt; which of these should we allow
&gt;   A(1,2,3,4)
&gt;   A((1,2,3,4))
&gt;   A((1,2),(3,4))
&gt;   A(1,(2,3),4)
&gt;   ...

Not sure what your getting at. OCaml makes otherwise redundant 
parentheses around constructor argument types significant. That is a 
hack to allow for a more efficient representation. The idea is to make 
that hack as transparent as possible.

But that aim of course is unrelated to changing the meaning of the 
multifix type operator * itself. So the first two of your examples 
should certainly be legal (and they are already), while the others 
should not, no more than

   ((1,2),(3,4)) : int * int * int * int  (* eek! *)
   (1,(2,3),4) : int * int * int * int   (* ouch! *)

- Andreas

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

"Computer games don't affect kids; I mean if Pac Man affected us
  as kids, we would all be running around in darkened rooms, munching
  magic pills, and listening to repetitive electronic music."
  - Kristian Wilson, Nintendo Inc.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

