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: -- (:)
From: John Carr <jfc@m...>
Subject: Re: [Caml-list] Unboxing options, was RE: assertions or exceptions?

[None represented internally as 0]

> What's the representation of Some(None) then?  The Some() goes away, and 
> the containing value is unboxed- it turns out to be the same as just None.  
> There is no way to differentiate Some(Some(Some(Some(None)))) from None.

There is also no way to distinguish 0 from None in the current
system.  OCaml relies on type information to determine the meaning
of a value.

Is there valid code (no Obj.magic) that cares that (Some None) and
(None) are both represented by the same bit pattern?

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