<?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/f4eccfa4676e4fcf89243cf0de154016"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2003-01-10T17:17:58"
  subject="Re: [Caml-list] Some, None and the caml-C interface"
  prev="2003/01/9eafc8c29bd075f861777389ece4e829"
  next="2003/01/1889606e7800e49e46e01c0a3d7cecd9"
  prev-in-thread="2003/01/c308ebaf6ce3d25799d84a98b9f6cd0a"
  prev-thread="2003/01/0e33f04291c4ee802ea2a08485d2b730"
  next-thread="2003/01/ef04a27385c591a8234c591df26a7c87"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Some, None and the caml-C interface">
<msg 
  url="2003/01/c308ebaf6ce3d25799d84a98b9f6cd0a"
  from="Yaron M. Minsky &lt;yminsky@C...&gt;"
  author="Yaron M. Minsky"
  date="2003-01-09T02:54:51"
  subject="[Caml-list] Some, None and the caml-C interface">
<msg 
  url="2003/01/f4eccfa4676e4fcf89243cf0de154016"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2003-01-10T17:17:58"
  subject="Re: [Caml-list] Some, None and the caml-C interface">
</msg>
</msg>
</thread>

<contents>
&gt; I've written some simple macros for accessing options in ocaml, and I
&gt; want to double check that they are actually right.  Does this look
&gt; right?

Yes, it is.

&gt; And is this documented anywhere?

The general representation of sum datatypes is described in section
18.3.4 of the OCaml manual.  If you "instantiate" this description to
the actual definition of type option
        type 'a option = None | Some of 'a
you can derive the macros that you posted.

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

