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 VAA11847; Thu, 15 Jul 2004 21:56:23 +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 VAA11498 for ; Thu, 15 Jul 2004 21:56:21 +0200 (MET DST) Received: from biscayne-one-station.mit.edu (BISCAYNE-ONE-STATION.MIT.EDU [18.7.7.80]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6FJuKEV009231 for ; Thu, 15 Jul 2004 21:56:21 +0200 Received: from manawatu-mail-centre.mit.edu (MANAWATU-MAIL-CENTRE.MIT.EDU [18.7.7.71]) by biscayne-one-station.mit.edu (8.12.4/8.9.2) with ESMTP id i6FJuKCq024464 for ; Thu, 15 Jul 2004 15:56:20 -0400 (EDT) Received: from psi-phi.mit.edu (PSI-PHI.MIT.EDU [18.187.1.35]) (authenticated bits=56) (User authenticated as jfc@ATHENA.MIT.EDU) by manawatu-mail-centre.mit.edu (8.12.4/8.12.4) with ESMTP id i6FJuJoM006280 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 15 Jul 2004 15:56:19 -0400 (EDT) Received: (from jfc@localhost) by psi-phi.mit.edu (8.12.9) id i6FJuJJJ004332; Thu, 15 Jul 2004 15:56:19 -0400 Message-Id: <200407151956.i6FJuJJJ004332@psi-phi.mit.edu> To: Subject: Re: [Caml-list] Unboxing options, was RE: assertions or exceptions? In-Reply-To: Your message of "Thu, 15 Jul 2004 13:20:00 EDT." Date: Thu, 15 Jul 2004 15:56:19 -0400 From: John Carr X-Miltered: at nez-perce with ID 40F6E164.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 unboxing:01 jfc:01 boxing:01 unboxing:01 unboxed:01 assertions:01 complexity:02 identical:03 identical:03 exceptions:04 exceptions:04 carr:05 mean:05 integer:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > One of the problems with returning error conditions instead of throwing > > exceptions is the cost of boxing a 'a option. I'd like to advocate for > > the idea of unboxing 'a options. > > This has been discussed before. The essential problem is this: > > Currently: > > type 'a option is not the same as type 'a option option > Some Some 1 is not the same as Some 1 > Some None is not the same as None > > With unboxed options: > > 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. ------------------- 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