DMB@PSUVMA.BITNET@ndmce.uucp (10/18/86)
Sorry I guess the question wasn't which languages support it, but why most of the major ones don't? 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
faustus@ucbcad.BERKELEY.EDU@ndmce.uucp (Wayne A. Christopher) (10/18/86)
In article <7871DMB@PSUVMA>, dmb@psuvm.bitnet.UUCP writes: > Sorry I guess the question wasn't which languages support it, but why > most of the major ones don't? 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
kend@tekla.UUCP (10/21/86)
[Flame on!] All right you guys. I am getting tired of this. What about all of the LISPs which allow (< x y z q) or [a la SCHEME]: (<? x y x w h q) et cetera? The problem with infix operators is that it is frequently difficult for compiler writers to generalize them efficiently, therefor you don't have the concise logical functions you want. With LISPs you are already dealing with parse trees so the generalization of operations and efficient compilation are there. Perhaps the newer parse tree editors will let you have the notation you want by defining the appropriate edit functions for your favorite language. Taking an efficiently compiled language such as Scheme and building an editor front end which elides the parens for you who don't like them is probably a better course. There is the danger here though. You might get used to, or even (God forbid!) get to like functional, object oriented etc. styles of programming. Come on guys, widen your paradigms! [!Flame off] -Ken Dickey
franka@mmintl.UUCP (Frank Adams) (10/24/86)
In article <341@ndmce.uucp> faustus@ucbcad.UUCP writes: >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. 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