Isn't it a direct translation from
if (x<y<z) then ... to ... if (x<y) and (y<z) ...
Thus the optimization arguement isn't valid.
One grows tired of writing,
if (thepoint[xdir,ydir].threepoint.x < 5) and
(thepoint[xdir,ydir].threepoint.x > 1) then
or some similarly boolean expression.
dave brosius
I think it is a matter of clean expression semantics -- 'x < y' has a value
which is a boolean, and so '(x < y) < z' doesn't mean what it should mean.
Another (tertiary) operator would do the job, as would
#define between(x, y, z) (((x) < (y)) && ((y) < (z)))
but I imagine that for the languages that do allow x < y < z, a large reason
why they aren't 'major' is that they are careless of semantic clarity and
orthagonality.
Wayne
I think it is a matter of clean expression semantics -- 'x < y' has a value
Whether you like it or not (I don't), COBOL is certainly a major language.
Nor is C, for example, especially careful about semantic clarity and
orthogonality -- consider pointers and arrays. I suspect the real reason is
that it makes writing the compilers slightly easier. (And I do mean
slightly -- this feature is not really hard to support.)
Frank Adams ihnp4!philabs!pwa-b!mmintl!franka
Multimate International 52 Oakland Ave North E. Hartford, CT 06108