Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!boulder!stan!dworkin From: dworkin@Solbourne.COM (Dieter Muller) Newsgroups: comp.lang.c Subject: Re: What I'd really like to see in an if-statement... Message-ID: <1864@salgado.Solbourne.COM> Date: 6 Aug 89 21:47:58 GMT References: <5024@alvin.mcnc.org> <1300@atanasoff.cs.iastate.edu> <456@helios.prosys.se> <14521@bfmny0.UUCP> Reply-To: dworkin@Solbourne.com (Dieter Muller) Organization: Solbourne Computer Inc., Longmont, Colorado Lines: 27 In article <14521@bfmny0.UUCP> tneff@bfmny0.UUCP (Tom Neff) writes: >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. I'd say what's wanted is more of an n-adic comparison operator, since it is occassionally nice to say ``if (a < b < c < d)'', etc. If you're going to generalize, do it all the way. >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. Unfortunately quite correct. Looks like another one of those ``in the successor of C'' sorts of things (please, let's not get *that* started again). 'Course, if someone felt ambitious, they could provide both interpretations, selected by a #pragma. If the construct appears before the compiler sees one of the appropriate #pragma's, it generates a warning and applies the "normal" interpretation. Dieter -- "Your spatial laws are ok, but God, the choices you give us." -- Deborah Blau boulder!stan!dworkin dworkin%stan@boulder.colorado.edu dworkin@solbourne.com Flamer's Hotline: (303) 678-4624 (1000 - 1800 Mountain Time)