Browse thread
[Caml-list] assertions or exceptions?
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| 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 <jfc@mit.edu> 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: http://pauillac.inria.fr/caml/caml-list/1834.html 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. John. ------------------- 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