What I'd really like to see in an if-statement...

Tom Neff tneff at bfmny0.UUCP
Mon Aug 7 02:42:36 AEST 1989


The complex expression

	val1 < x < val2

(and by extension, the 24 other forms possible with <, <=, ==, >= and >)
really has nothing to do with the 'if' statement, so the subject name
of this thread is inaccurate.  What's wished for is a triadic comparison
operator, which could then be used in any of the boolean contexts that
a simple binary comparison can be used now.

It would be fun to have such a thing, it would make expressing lots of
conditions more concise and everyone would use it.  However it would
break a lot of things in "C" (the expression above IS VALID C right now,
for instance, with a totally different meaning) and parsing would be a
nightmare.  I wouldn't hold my breath.
-- 
"We walked on the moon --	((	Tom Neff
	you be polite"		 )) 	tneff at bfmny0.UU.NET



More information about the Comp.lang.c mailing list