Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Some, None and the caml-C interface
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-01-10 (17:17)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] Some, None and the caml-C interface
> I've written some simple macros for accessing options in ocaml, and I
> want to double check that they are actually right.  Does this look
> right?

Yes, it is.

> 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 Archives:
Bug reports: FAQ:
Beginner's list: