<?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="2006/02/e4f6b68e8494e3b0bb9337a82a869f9d"
  from="Frédéric_Gava &lt;gava@u...&gt;"
  author="Frédéric_Gava"
  date="2006-02-23T22:26:19"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?"
  prev="2006/02/c6a52c8dca9745c4c16caf17b126c89b"
  next="2006/02/02afb32cb15cb612c47d0d5dc141db6c"
  prev-in-thread="2006/02/c6a52c8dca9745c4c16caf17b126c89b"
  next-in-thread="2006/02/02afb32cb15cb612c47d0d5dc141db6c"
  prev-thread="2006/02/8f3c94deba723122c8e8a54777c4b2c3"
  next-thread="2006/02/af620428b9e5973d1b1d679cf7d0bc61"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="(int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/f908dcb156bd0fb005460b3a0e333f44"
  from="Frédéric_Gava &lt;gava@u...&gt;"
  author="Frédéric_Gava"
  date="2006-02-23T17:24:00"
  subject="(int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/de0896f18b44131131c47598d65a5179"
  from="Thomas Fischbacher &lt;Thomas.Fischbacher@P...&gt;"
  author="Thomas Fischbacher"
  date="2006-02-23T18:33:11"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
</msg>
<msg 
  url="2006/02/51e2e002bcb0a7bc3b80d355a8f435cc"
  from="Eric Cooper &lt;ecc@c...&gt;"
  author="Eric Cooper"
  date="2006-02-23T18:33:27"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/43c9eac16d4b847d6b2f4970ed5dd958"
  from="Frédéric_Gava &lt;gava@u...&gt;"
  author="Frédéric_Gava"
  date="2006-02-23T19:03:09"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/2ac136544989c9965de7889aca06ee1b"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2006-02-23T20:15:54"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/3848289acfe3eed7d516508d957bb91d"
  from="Frédéric_Gava &lt;gava@u...&gt;"
  author="Frédéric_Gava"
  date="2006-02-23T21:26:06"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/c6a52c8dca9745c4c16caf17b126c89b"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2006-02-23T21:57:23"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/e4f6b68e8494e3b0bb9337a82a869f9d"
  from="Frédéric_Gava &lt;gava@u...&gt;"
  author="Frédéric_Gava"
  date="2006-02-23T22:26:19"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/02afb32cb15cb612c47d0d5dc141db6c"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2006-02-23T22:50:07"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/15202f64dadd29700ecfd2c0a70cfe23"
  from="Frédéric_Gava &lt;gava@u...&gt;"
  author="Frédéric_Gava"
  date="2006-02-23T23:04:10"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2006/02/fa8024e942755bfff622daa504e0e477"
  from="Alessandro Baretta &lt;a.baretta@s...&gt;"
  author="Alessandro Baretta"
  date="2006-02-24T08:38:15"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
</msg>
<msg 
  url="2006/02/1245b24d768342c39d5fe0d071df339f"
  from="Damien Doligez &lt;damien.doligez@i...&gt;"
  author="Damien Doligez"
  date="2006-02-24T12:58:27"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
</msg>
</msg>
<msg 
  url="2006/02/3cb262981f289a53406067bbd69f4a63"
  from="Martin Jambon &lt;martin_jambon@e...&gt;"
  author="Martin Jambon"
  date="2006-02-23T19:03:46"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
</msg>
</msg>
<msg 
  url="2006/02/9214baed0e98dcabf751588485427321"
  from="David Brown &lt;caml-list2@d...&gt;"
  author="David Brown"
  date="2006-02-23T18:56:27"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/a95a53378601a6ef27bf04016da04957"
  from="Frédéric_Gava &lt;gava@u...&gt;"
  author="Frédéric_Gava"
  date="2006-02-23T19:20:18"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
</msg>
<msg 
  url="2006/02/0b3bc51e4b763cc117bce49314bdae98"
  from="Frédéric_Gava &lt;gava@u...&gt;"
  author="Frédéric_Gava"
  date="2006-02-23T19:33:24"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/551b9511c41004bfbad101cb98485026"
  from="Frédéric_Gava &lt;gava@u...&gt;"
  author="Frédéric_Gava"
  date="2006-02-23T19:41:12"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/b4d6acda6a9b61e2802db26ce8cfe28d"
  from="Jacques Garrigue &lt;garrigue@m...&gt;"
  author="Jacques Garrigue"
  date="2006-02-24T00:01:34"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/d6a42c6fd193ddcb0fc6d82618bbf2b6"
  from="Lukasz Stafiniak &lt;lukstafi@g...&gt;"
  author="Lukasz Stafiniak"
  date="2006-02-24T00:18:29"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/f29e8f26e5c09b618405f3c4af1f8e47"
  from="Jacques Garrigue &lt;garrigue@m...&gt;"
  author="Jacques Garrigue"
  date="2006-02-24T02:17:42"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/efcb861d4b61cfe98f7d51a795e43854"
  from="Alain Frisch &lt;Alain.Frisch@i...&gt;"
  author="Alain Frisch"
  date="2006-02-24T13:08:03"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/9011019f1548d4c4eb8d3228e181aa0e"
  from="Vincent Balat &lt;Vincent.Balat@p...&gt;"
  author="Vincent Balat"
  date="2006-02-25T17:41:10"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/775002c824fb8dccd1cd65d07f2ad334"
  from="Nicolas Pouillard &lt;nicolas.pouillard@i...&gt;"
  author="Nicolas Pouillard"
  date="2006-02-25T18:30:43"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/adbb2416b5591674c71751d4f1102507"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2006-02-25T19:10:57"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/03/035347eafbbed7c98f5f4f25c451def0"
  from="Nicolas Pouillard &lt;nicolas.pouillard@i...&gt;"
  author="Nicolas Pouillard"
  date="2006-03-01T12:48:36"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
</msg>
</msg>
<msg 
  url="2006/02/159398f49c4b0dc05c919326cec4e940"
  from="Christophe TROESTLER &lt;Christophe.Troestler@u...&gt;"
  author="Christophe TROESTLER"
  date="2006-02-25T23:17:15"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/03/e85422971f0d6dbe2936c813b487d443"
  from="Nicolas Pouillard &lt;nicolas.pouillard@i...&gt;"
  author="Nicolas Pouillard"
  date="2006-03-01T13:01:04"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
</msg>
</msg>
<msg 
  url="2006/02/fdb2c12e4c1c212594609ce82eaed570"
  from="Hendrik Tews &lt;tews@t...&gt;"
  author="Hendrik Tews"
  date="2006-02-27T11:14:29"
  subject="camlp4 renovation [was: [Caml-list] (int * int) &lt;&gt; int*int ?]">
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2006/02/bdac4aa5b2244cbd120789ea79be308e"
  from="Nicolas Cannasse &lt;ncannasse@m...&gt;"
  author="Nicolas Cannasse"
  date="2006-02-24T13:40:15"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/297a917656dcb71de5ca865366502383"
  from="Frédéric_Gava &lt;gava@u...&gt;"
  author="Frédéric_Gava"
  date="2006-02-24T14:44:03"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2006/02/6a5b68050a1484acd0c68d8d0e6d23f0"
  from="Sebastian Egner &lt;sebastian.egner@p...&gt;"
  author="Sebastian Egner"
  date="2006-02-24T08:29:47"
  subject="also for tagged records? [Was: Re: [Caml-list] (int * int) &lt;&gt; int*int ?]">
<msg 
  url="2006/02/1c809cfa5cccc01d014db0fa7774573f"
  from="Thomas Fischbacher &lt;Thomas.Fischbacher@P...&gt;"
  author="Thomas Fischbacher"
  date="2006-02-24T14:01:33"
  subject="Re: also for tagged records? [Was: Re: [Caml-list] (int * int) &lt;&gt; int*int ?]">
</msg>
</msg>
</msg>
<msg 
  url="2006/02/9f7a7b80203928ffe736136f261e8446"
  from="Jon Harrop &lt;jon@f...&gt;"
  author="Jon Harrop"
  date="2006-02-23T21:18:34"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
<msg 
  url="2006/02/00239c5425a51b829eb0d85f1346be85"
  from="Frédéric_Gava &lt;gava@u...&gt;"
  author="Frédéric_Gava"
  date="2006-02-23T21:32:37"
  subject="Re: [Caml-list] (int * int) &lt;&gt; int*int ?">
</msg>
</msg>
</msg>
</thread>

<contents>
&gt;No.  There are cases where (int*int*int) is not the same as int*int*int.
&gt;Specifically, int*(int*int*int) is different than int*int*int*int.

As a sub-part of a type, ok but I speak about general parentheses...

&gt;You keep trying to assume that the parentheses are purely syntactic-
&gt;they're not.

I have never say that...you can read that i have write int-&gt;int-&gt;int &lt;&gt;
(int-&gt;int)-&gt;int

&gt;So, in terms of representation:
&gt;type t = A of int * int
&gt;is represented in memory as
&gt;     tag * int * int
&gt;while
&gt;type t' = B of (int * int)
&gt;is represented in memory as
&gt;     tag * (int * int)
&gt;where in both cases tag is the tagging information added by the compiler.
&gt;Note that in the first case it's a three word structure (two ints and a
&gt;tag), while in the second case it's a two word structure (a tag and a
&gt;reference to a tuple of two ints).

But where tag could represent information both int*int and (int*int) which
is the same things (modulo an indirection which could be deleted at
pattern-mathching). Morever, as Jon points of, variant types do not have
this curious things due to boxed values...Also when you have build a pair,
semantically you want to apply the constructor on this pair...because,
there no partial applications of the constructors : for a constructor A of
int*int you can not write (A 3) of type int-&gt;t (as in mini-ML or Haskell). I
understand (and agree) the performances reasons, but I thinks that could be
deleted since the only (that i see) case where the performances are
differents is in the case of pattern-matching...


&gt;No.  Because in the case of B, I can snag the tuple as an independent
&gt;peice of data.  For example, I can write:
&gt;  let f = function B x -&gt; fst x;;
&gt;and it works.  On the other hand, if I try to write:
&gt;  let g = function A x -&gt; fst x;;
&gt;this doesn't work- because the "tuple" in A doesn't really exist as an
&gt;independent data structure (it's been unboxed).  Here, Ocaml is refusing
&gt;to allow a pointer into the middle of a structure (the GC algorithm thanks
&gt;you), and doesn't want to have to allocate a tuple to hold x (this
&gt;seriously complicates pattern matching).

Peraps it complicates the pattern-matching but in the second case, x could
be quickly and automatically build from (A x) because tags of tuples and of
concrete types are close...and you avoid this curious construction  (many
years that I program in ocaml and curiously, never saw this things because
always build the different parameters of the concrete constructor in
different "variables" ;-)  so I think that it is not a problem that appear
many times in ocaml programs...some one always used the two differents
constructions ?)


FG



</contents>

</message>

