<?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="2009/10/970c5b49cb35ab3fae6528efb851857c"
  from="Anil Madhavapeddy &lt;anil@r...&gt;"
  author="Anil Madhavapeddy"
  date="2009-10-03T18:29:28"
  subject="Re: [Caml-list] Generation of Java code from OCaml"
  prev="2009/10/9ff40d06808df7ebb5d336e0f03fc68b"
  next="2009/10/1d7452042a610a8dbce7b15598651158"
  prev-in-thread="2009/10/9ff40d06808df7ebb5d336e0f03fc68b"
  next-in-thread="2009/09/43e425986cb065c18ef92743b32cb74b"
  prev-thread="2009/09/73ef227324d51c3763375d0428a2233a"
  next-thread="2009/09/e654e44c4c8eec753dff6cd3c7c52d68"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Generation of Java code from OCaml">
<msg 
  url="2009/09/4e92d2c97f93cc2b345ed338517d4b92"
  from="Mykola Stryebkov &lt;nick@m...&gt;"
  author="Mykola Stryebkov"
  date="2009-09-23T18:15:16"
  subject="Generation of Java code from OCaml">
<msg 
  url="2009/09/7da295604997571a18bcd51a8146b2ee"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2009-09-23T19:57:16"
  subject="Re: [Caml-list] Generation of Java code from OCaml">
<msg 
  url="2009/09/4836b7a977687ee8e9e0ee3f27cba4a1"
  from="Mykola Stryebkov &lt;nick@m...&gt;"
  author="Mykola Stryebkov"
  date="2009-09-23T22:54:24"
  subject="Re: [Caml-list] Generation of Java code from OCaml">
<msg 
  url="2009/09/6bd9fd91721ef76b3401a60d460742d8"
  from="David Allsopp &lt;dra-news@m...&gt;"
  author="David Allsopp"
  date="2009-09-24T08:04:08"
  subject="RE: [Caml-list] Generation of Java code from OCaml">
<msg 
  url="2009/09/e91074dc599ff6e957de727792621cf3"
  from="blue storm &lt;bluestorm.dylc@g...&gt;"
  author="blue storm"
  date="2009-09-24T09:45:32"
  subject="Re: [Caml-list] Generation of Java code from OCaml">
<msg 
  url="2009/09/32eba4e3114fc90a6f702c5c4797299f"
  from="Martin Jambon &lt;martin.jambon@e...&gt;"
  author="Martin Jambon"
  date="2009-09-24T11:26:31"
  subject="Re: [Caml-list] Generation of Java code from OCaml">
<msg 
  url="2009/09/fb85714bd6ba2b1bdabe4635306284f7"
  from="blue storm &lt;bluestorm.dylc@g...&gt;"
  author="blue storm"
  date="2009-09-24T12:02:17"
  subject="Re: [Caml-list] Generation of Java code from OCaml">
<msg 
  url="2009/09/8dc69d73f35aab73e2917c4e09adb471"
  from="Martin Jambon &lt;martin.jambon@e...&gt;"
  author="Martin Jambon"
  date="2009-09-24T12:27:45"
  subject="Re: [Caml-list] Generation of Java code from OCaml">
<msg 
  url="2009/10/bdaff94c0ba36d59e0c3bee8f4d5e4b2"
  from="Anil Madhavapeddy &lt;anil@r...&gt;"
  author="Anil Madhavapeddy"
  date="2009-10-03T12:16:28"
  subject="Re: [Caml-list] Generation of Java code from OCaml">
<msg 
  url="2009/10/9ff40d06808df7ebb5d336e0f03fc68b"
  from="blue storm &lt;bluestorm.dylc@g...&gt;"
  author="blue storm"
  date="2009-10-03T17:28:00"
  subject="Re: [Caml-list] Generation of Java code from OCaml">
<msg 
  url="2009/10/970c5b49cb35ab3fae6528efb851857c"
  from="Anil Madhavapeddy &lt;anil@r...&gt;"
  author="Anil Madhavapeddy"
  date="2009-10-03T18:29:28"
  subject="Re: [Caml-list] Generation of Java code from OCaml">
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2009/09/43e425986cb065c18ef92743b32cb74b"
  from="ygrek &lt;ygrekheretix@g...&gt;"
  author="ygrek"
  date="2009-09-26T07:37:49"
  subject="Re: [Caml-list] Generation of Java code from OCaml">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
On 3 Oct 2009, at 18:27, blue storm wrote:

&gt; On Sat, Oct 3, 2009 at 2:16 PM, Anil Madhavapeddy &lt;anil@recoil.org&gt;  
&gt; wrote:
&gt;&gt; The only thing I haven't quite worked out yet is the quotation to
&gt;&gt; pattern-match type applications to detect things like "(string, unit)
&gt;&gt; Hashtbl.t" the way the current json-static does via the grammar  
&gt;&gt; extension.
&gt;&gt; -anil
&gt;
&gt; Below are two patches (from `git log -u`) adding the relevant  
&gt; features.
&gt;
(snip)
&gt; -
&gt; + | &lt;:ctyp&lt; assoc $t$ &gt;&gt; as assoc -&gt;
&gt; +   (match t with
&gt; +      | &lt;:ctyp&lt; (string * $t$) &gt;&gt; -&gt; Assoc (_loc, process_td _loc t)
&gt; +      | _ -&gt; failwith "must be of the form (string * ...) assoc")
&gt;  | &lt;:ctyp&lt; &lt; $cs$ &gt; &gt;&gt; -&gt; Object (process_fields _loc cs)
&gt;  | &lt;:ctyp&lt; { $cs$ } &gt;&gt; -&gt; Record (process_fields _loc cs)

Thanks; my goal is to avoid putting in special types into type-conv  
generators though ('assoc' here), so they can be used alongside other  
generators too.

It seems reasonable to just special-case "Hashtbl.t string $t$" and  
"list ( string * $t$ )", since JSON objects must have a string as the  
key. I've pushed a patch which does that to my tree, along with some  
of your other changes.

-anil
</contents>

</message>

