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 EAA18294; Thu, 15 Jan 2004 04:57:23 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id EAA19473 for ; Thu, 15 Jan 2004 04:57:21 +0100 (MET) Received: from mail4.tpgi.com.au (mail.tpgi.com.au [203.12.160.61]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id i0F3vJ502955 for ; Thu, 15 Jan 2004 04:57:20 +0100 (MET) Received: from 203-213-127-125-syd-ts20-2600.tpgi.com.au (203-213-127-125-syd-ts20-2600.tpgi.com.au [203.213.127.125]) by mail4.tpgi.com.au (8.12.10/8.12.10) with ESMTP id i0F3vDRN017644; Thu, 15 Jan 2004 14:57:15 +1100 Subject: Re: [Caml-list] Stupid question From: skaller Reply-To: skaller@tpg.com.au To: Brian Hurt Cc: Ocaml Mailing List In-Reply-To: References: Content-Type: text/plain Message-Id: <1074139041.7527.2.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 15 Jan 2004 14:57:22 +1100 Content-Transfer-Encoding: 7bit X-TPG-Antivirus: Passed X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 stupid:01 tpg:99 2004:99 poking:01 inequality:01 tpg:99 glebe:01 2037,:01 9660:01 compiler:01 compiler:01 ints:01 ocaml:01 nsw:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 2004-01-15 at 11:03, Brian Hurt wrote: > I was poking around in the produced assembly code of some ocaml code of > mine, and I noticed something. The construct: > if (x < m) <> (y < m) then > ... > > when the compiler knows that x, y, and m are all ints, it calls an > external C routine to compare the two booleans. But the construct: > > if (x < m) != (y < m) then > ... > > does not. Now, this isn't a big deal- I just replaced <> with != and no > problem. But I was kind of interested in why the compiler didn't catch > and optimize this. Is there some sort of subtle semantic difference I'm > too dense to see? Well, <> is a polymorphic value comparison. Whereas != is a physical inequality comparison. -- John Max Skaller, mailto:skaller@tpg.com.au snail:25/85c Wigram Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850. Checkout Felix: http://felix.sf.net ------------------- 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