Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!sun-barr!rutgers!mcnc!spl From: spl@mcnc.org (Steve Lamont) Newsgroups: comp.lang.c Subject: What I'd really like to see in an if-statement... Message-ID: <5024@alvin.mcnc.org> Date: 5 Aug 89 15:02:43 GMT Reply-To: spl@mcnc.org.UUCP (Steve Lamont) Organization: Microelectronics Center of NC; RTP, NC Lines: 28 All this discussion about arithmetic ifs has goaded me into posting my own particular pet construct. Since I do a lot of programming that involves mathematical expressions of one sort of another I often find myself wishing for an if construct that looks like if ( foo < bar < baz ) do_something(); else do_something_else(); which is, of course, equivalent to if ( ( foo < bar ) && ( bar < baz ) ) do_something(); else do_something_else(); Is there any reason why such a construction is not practical? If not, why has no language (that I am aware of or can program in) implemented such a construction? Good idea or bad idea? -- spl Steve Lamont, sciViGuy EMail: spl@ncsc.org North Carolina Supercomputing Center Phone: (919) 248-1120 Box 12732/RTP, NC 27709