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] assertions or exceptions?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-07-15 (21:04)
From: John Prevost <j.prevost@g...>
Subject: Re: [Caml-list] Unboxing options, was RE: assertions or exceptions?
On Thu, 15 Jul 2004 15:56:19 -0400, John Carr <> wrote:
> > type 'a option is the same as type 'a option option
> > Some Some 1 is identical to Some 1
> > Some None is identical to None
> So use true 0 as opposed to the integer 0 internally represented as 1
> to mean "None".  This adds some complexity but may be worth the effort
> as options are common.

That doesn't actually help.  How do you distinguish the value Some
None from None?  Are you suggesting Some None would be integer 0, and
None would be pointer NULL?  Then what about an int option option
option?  Yes, it's a little silly, but it's a reasonable concern.

I agree that having options be supported unboxed would be kind of
nice, but I'm not sure it's worth the effort involved.

Just did some searching around and managed to find the old discussion
that I was involved in:  I don't see a clear
"no" in the discussion there.  But perhaps browsing around that thread
can show you a bit about this can of worms.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: