<?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/07/813bceb9981111a4ecb3a4e5773de997"
  from="Chris Hecker &lt;checker@d...&gt;"
  author="Chris Hecker"
  date="2003-07-28T03:43:13"
  subject="Re: [Caml-list] naming parts of optional arguments?"
  prev="2003/07/1dc0ea4c24df95060786886f24653edd"
  next="2003/07/b4454db83baee6171cc89bb50c35748f"
  prev-in-thread="2003/03/14613e93c23bda4f4329db2dbc87593e"
  next-in-thread="2003/07/b4454db83baee6171cc89bb50c35748f"
  prev-thread="2003/03/386b601bed4a77644727a870ecb9b650"
  next-thread="2003/03/1093f82a8413923ed0b56594e9cc3f1f"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] naming parts of optional arguments?">
<msg 
  url="2003/03/119f206668e58a6a506aaca149c5b9cd"
  from="Chris Hecker &lt;checker@d...&gt;"
  author="Chris Hecker"
  date="2003-03-28T01:09:51"
  subject="[Caml-list] naming parts of optional arguments?">
<msg 
  url="2003/03/f3bf978bb3304d9c9091a49a5a30fe8f"
  from="Chris Hecker &lt;checker@d...&gt;"
  author="Chris Hecker"
  date="2003-03-28T01:14:42"
  subject="Re: [Caml-list] naming parts of optional arguments?">
<msg 
  url="2003/03/14613e93c23bda4f4329db2dbc87593e"
  from="Chris Hecker &lt;checker@d...&gt;"
  author="Chris Hecker"
  date="2003-03-28T02:15:45"
  subject="Re: [Caml-list] naming parts of optional arguments?">
<msg 
  url="2003/07/813bceb9981111a4ecb3a4e5773de997"
  from="Chris Hecker &lt;checker@d...&gt;"
  author="Chris Hecker"
  date="2003-07-28T03:43:13"
  subject="Re: [Caml-list] naming parts of optional arguments?">
<msg 
  url="2003/07/b4454db83baee6171cc89bb50c35748f"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-07-28T07:19:00"
  subject="Re: [Caml-list] naming parts of optional arguments?">
<msg 
  url="2003/07/749c12c565ddbf0ae14c53f7880c11dc"
  from="Chris Hecker &lt;checker@d...&gt;"
  author="Chris Hecker"
  date="2003-07-28T16:35:21"
  subject="Re: [Caml-list] naming parts of optional arguments?">
<msg 
  url="2003/07/81a0bd462ef07ae6386a9582e266680a"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-07-29T03:20:02"
  subject="Re: [Caml-list] naming parts of optional arguments?">
<msg 
  url="2003/07/3f3ced666b2a7750ac278ca971c5f0bc"
  from="Chris Hecker &lt;checker@d...&gt;"
  author="Chris Hecker"
  date="2003-07-29T21:52:34"
  subject="Re: [Caml-list] naming parts of optional arguments?">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/03/1cfe6461b4857eaa0ae5dc27581fe317"
  from="Max Kirillov &lt;max630@m...&gt;"
  author="Max Kirillov"
  date="2003-03-28T01:46:05"
  subject="Re: [Caml-list] naming parts of optional arguments?">
</msg>
</msg>
</thread>

<contents>

[old thread resurrected]

Actually, I spoke too soon below, you have to have the "as xy" on there to 
be able to reference the tuple by xy.  Doesn't that seem redundant given 
the ?xy: specification (which doesn't seem to be used)?

# let f ?xy:((x,y)=(0,0)) () = x + y;;
val f : ?xy:int * int -&gt; unit -&gt; int = &lt;fun&gt;
# let f ?xy:((x,y)=(0,0)) () = xy;;
Characters 29-31:
   let f ?xy:((x,y)=(0,0)) () = xy;;
                                ^^
Unbound value xy
# let f ?xy:((x,y) as xy =(0,0)) () = xy;;
val f : ?xy:int * int -&gt; unit -&gt; int * int = &lt;fun&gt;
# let f ?xy:((x,y) as blah =(0,0)) () = blah;;
val f : ?xy:int * int -&gt; unit -&gt; int * int = &lt;fun&gt;
#

Chris



At 18:11 3/27/2003 -0800, Chris Hecker wrote:

&gt;James replied off list, but I thought the others might like to see it:
&gt;
&gt;At 17:35 3/27/2003 -0800, james woodyatt wrote:
&gt;&gt;# let f ?xy:(x,y as xy = 0.0,0.0) () = xy;;
&gt;&gt;val f : ?xy:float * float -&gt; unit -&gt; float * float = &lt;fun&gt;
&gt;
&gt;Ah, that's what I wanted, thanks!  It looks like you can just do ?xy:(x,y 
&gt;= 0,0) and skip the "as xy" too.  Wacky syntax...it looks like I should 
&gt;have looked in the pseudo-bnf before posting since it looks like this is 
&gt;in there.
&gt;
&gt;Thanks,
&gt;Chris
&gt;
&gt;
&gt;-------------------
&gt;To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
&gt;Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
&gt;Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

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

