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 CAA05576; Fri, 16 Jan 2004 02:34:00 +0100 (MET) 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 CAA05352 for ; Fri, 16 Jan 2004 02:33:59 +0100 (MET) Received: from herd.plethora.net (herd.plethora.net [205.166.146.1]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id i0G1Xv524476 for ; Fri, 16 Jan 2004 02:33:58 +0100 (MET) Received: from bhurt.plethora.net (bhurt.plethora.net [205.166.146.49]) by herd.plethora.net (8.11.6/8.10.1) with ESMTP id i0G1XVZ27245; Thu, 15 Jan 2004 19:33:31 -0600 (CST) Date: Thu, 15 Jan 2004 20:35:56 -0600 (CST) From: Brian Hurt X-X-Sender: bhurt@localhost.localdomain To: Jacques Garrigue cc: skaller@tpg.com.au, Subject: Re: [Caml-list] Stupid question In-Reply-To: <20040116094357V.garrigue@kurims.kyoto-u.ac.jp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 stupid:01 jacques:01 tpg:99 optimised:01 non-constant:01 optimised:01 compiler:01 bool:01 bool:01 int:01 int:01 garrigue:01 constructors:01 constructors:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 16 Jan 2004, Jacques Garrigue wrote: > From: skaller > Yes indeed. > But the compiler is clever enough to use specific comparison functions > when the type is known to be int or float. > Since bool looks like a subset of int, one might expect it to be > optimised also. However, bool is just a normal sum type, and since > some sum types have non-constant constructors, in general sum types > require a recursive comparison operation. > For types where constructors are constant, this might be optimised... OK. This makes more sense. Well, except for the nitpicking detail that true and false are not valid variant type identifiers, they should be True and False. -- "Usenet is like a herd of performing elephants with diarrhea -- massive, difficult to redirect, awe-inspiring, entertaining, and a source of mind-boggling amounts of excrement when you least expect it." - Gene Spafford Brian ------------------- 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