Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!sharkey!atanasoff!hascall From: hascall@atanasoff.cs.iastate.edu (John Hascall) Newsgroups: comp.lang.c Subject: Re: What I'd really like to see in an if-statement... Message-ID: <1302@atanasoff.cs.iastate.edu> Date: 6 Aug 89 15:14:00 GMT References: <5024@alvin.mcnc.org> <1300@atanasoff.cs.iastate.edu> <5027@alvin.mcnc.org> Reply-To: hascall@atanasoff.cs.iastate.edu.UUCP (John Hascall) Organization: Iowa State Univ. Computation Center Lines: 24 In article <5027> spl@mcnc.org.UUCP (Steve Lamont) writes: }In article <1300> hascall@atanasoff.cs.iastate.edu.UUCP (John Hascall) writes: }@In article <5024> spl@mcnc.org.UUCP (Steve Lamont) writes: }@} if ( foo < bar < baz ) ... }@} Good idea or bad idea? }@ }@ It's in COBOL (along with everything else). }@ To answer your other question, COBOL is a bad idea. }That really doesn't address the question: is the mathematical inequality test }shown in my example a *bad* idea? Sorry, I should have followed that last bit with a smiley :-) I can see no reason why it is a bad idea (from a programming standpoint). And I can come up with a reason why it is a good idea (side effects): while (min < *ptr++ < max) ... I can see no way to do this sort of thing as cleanly with ``< && <''. I compiler writer might have other opinions though! John