From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA14269; Thu, 15 Jul 2004 23:04:14 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA13674 for ; Thu, 15 Jul 2004 23:04:13 +0200 (MET DST) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.204]) by nez-perce.inria.fr (8.12.10/8.12.10) with SMTP id i6FL4BEV015689 for ; Thu, 15 Jul 2004 23:04:12 +0200 Received: by mproxy.gmail.com with SMTP id d78so437349rnf for ; Thu, 15 Jul 2004 14:04:11 -0700 (PDT) Received: by 10.38.9.24 with SMTP id 24mr186013rni; Thu, 15 Jul 2004 14:04:11 -0700 (PDT) Message-ID: Date: Thu, 15 Jul 2004 17:04:11 -0400 From: John Prevost To: Ocaml Mailing List Subject: Re: [Caml-list] Unboxing options, was RE: assertions or exceptions? In-Reply-To: <200407151956.i6FJuJJJ004332@psi-phi.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <200407151956.i6FJuJJJ004332@psi-phi.mit.edu> X-Miltered: at nez-perce with ID 40F6F14B.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; prevost:01 prevost:01 caml-list:01 unboxing:01 2004:99 0400,:01 jfc:01 unboxed:01 caml-list:01 caml:01 null:01 int:01 assertions:01 supported:01 distinguish:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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: 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