Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Stupid question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-01-14 (23:01)
From: Brian Hurt <bhurt@s...>
Subject: [Caml-list] Stupid question

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?

"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 

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: