Version française
Home     About     Download     Resources     Contact us    
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 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