<?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/01/93b1291528684957aead21b72f0a9544"
  from="brogoff@s..."
  author="brogoff@s..."
  date="2003-01-10T14:34:43"
  subject="Re: [Caml-list] record declaration, SML"
  prev="2003/01/d8417aedf95bf5c2b3a46eab0eafe2d3"
  next="2003/01/a5817ced25cbb70715d7f05098aafb39"
  prev-in-thread="2003/01/78b896e07d18240e06adb3dd5c3c7870"
  next-in-thread="2003/01/f9c3d99bba40e8cf1b94eb7cb5777c81"
  prev-thread="2003/01/37bde005f875aa75e55ca6ee21ec7ede"
  next-thread="2003/01/277d23fbd8d964d99d8b80b7f032590a"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] record declaration, SML">
<msg 
  url="2003/01/3eeaa34f72ab83397e790fabbb1b7306"
  from="A. Ozmen &lt;aoz@d...&gt;"
  author="A. Ozmen"
  date="2003-01-09T18:04:44"
  subject="[Caml-list] record declaration, SML">
<msg 
  url="2003/01/9948de611fa2a519a7c4aa54234716d9"
  from="brogoff@s..."
  author="brogoff@s..."
  date="2003-01-09T18:28:00"
  subject="Re: [Caml-list] record declaration, SML">
<msg 
  url="2003/01/78b896e07d18240e06adb3dd5c3c7870"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2003-01-10T09:21:17"
  subject="Re: [Caml-list] record declaration, SML">
<msg 
  url="2003/01/93b1291528684957aead21b72f0a9544"
  from="brogoff@s..."
  author="brogoff@s..."
  date="2003-01-10T14:34:43"
  subject="Re: [Caml-list] record declaration, SML">
</msg>
</msg>
<msg 
  url="2003/01/f9c3d99bba40e8cf1b94eb7cb5777c81"
  from="A. Ozmen &lt;aoz@d...&gt;"
  author="A. Ozmen"
  date="2003-01-10T09:36:18"
  subject="Re: [Caml-list] record declaration, SML">
</msg>
</msg>
<msg 
  url="2003/01/1ca66d24a440edbd8e33b050a8ffc794"
  from="Daniel de Rauglaudre &lt;daniel.de_rauglaudre@i...&gt;"
  author="Daniel de Rauglaudre"
  date="2003-01-09T22:42:08"
  subject="Re: [Caml-list] record declaration, SML">
<msg 
  url="2003/01/d88536eb5cd8c413b396f1cff8f000e6"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2003-01-09T23:11:48"
  subject="Re: [Caml-list] record declaration, SML">
<msg 
  url="2003/01/5139d8a47eedbc92eee9fe549d84283c"
  from="Daniel de Rauglaudre &lt;daniel.de_rauglaudre@i...&gt;"
  author="Daniel de Rauglaudre"
  date="2003-01-10T02:59:41"
  subject="Re: [Caml-list] record declaration, SML">
</msg>
<msg 
  url="2003/01/be4cf6635106b2ef386963204ac08a99"
  from="brogoff@s..."
  author="brogoff@s..."
  date="2003-01-10T03:45:45"
  subject="Re: [Caml-list] record declaration, SML">
<msg 
  url="2003/01/e1fc2cb6dafc061afc5f6f4faf822561"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2003-01-10T07:43:33"
  subject="Re: [Caml-list] record declaration, SML">
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
On Fri, 10 Jan 2003, Xavier Leroy wrote:
&gt; &gt; There are a few other conveniences in SML record handling too, like the ... 
&gt; &gt; notation, that don't exist in OCaml. 
&gt; 
&gt; You mean, in pattern-matching over records?  Caml offers the same
&gt; functionality without the ... notation, e.g.
&gt; 
&gt;         type r = { x: int; y: int }
&gt; 
&gt;         match r with { x = 1 } -&gt; ...
&gt; 
&gt; Because records are declared in advance, there is no requirement that
&gt; all record labels be mentioned in a pattern matching.

Right, but if I'm not mistaken, SML forces you to use the ... in record 
pattern matching when you want to ignore some labels in the match. As you 
suggest, this is a lot more important in SML, but even in OCaml it would be 
a bit better IMO to explicitly distinguish between ignoring some labels 
and forgetting some, so that slovenly programmers (like yours truly) could 
depend on the type checker to slap them when they miss fields. Unfortunately, 
OCaml behaves as though every record pattern match had an implicit ..., so I 
don't see a good way out even if the developers agreed that this was worth 
fixing.

File that one under "petty complaints", or, if you're feeling generous in this 
new year, under the non-petty "Oh how I wish we had more polymorphism in 
records!" complaint :-)

-- Brian


-------------------
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>

