Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!tandem!zorch!ditka!zinn!siia!drd From: drd@siia.mv.com (David Dick) Newsgroups: comp.lang.c Subject: Re: cond. op. on ='s LHS Message-ID: <1991Feb19.205706.28454@siia.mv.com> Date: 19 Feb 91 20:57:06 GMT References: <4155@cernvax.cern.ch> <11073@pasteur.Berkeley.EDU> <15184@smoke.brl.mil> <326@smds.UUCP> Organization: Software Innovations, Inc. Lines: 29 In <326@smds.UUCP> rh@smds.UUCP (Richard Harter) writes: >In article <15184@smoke.brl.mil>, gwyn@smoke.brl.mil (Doug Gwyn) writes: >> In article <11073@pasteur.Berkeley.EDU>, johnm@cory.Berkeley.EDU (John D. Mitchell) writes: >> - In article <4155@cernvax.cern.ch> burow@cernvax.cern.ch (burkhard burow) writes: >> - >I'm wondering if anyone has any comments on using: >> - > *(a==b?&c:&d) = 1; >> - >instead of: >> - > if (a==b) c=1; >> - > else d=1; >Seriously, there is a germ of a good idea here. The example is inane, >but consider > *(a==b?&c:&d) = >One really doesn't want to code in said messy expression twice, so one >tends to write something like > temp = > if (a==b) c = temp; > else d = temp; I believe that the result of a conditional expression is explicitly defined to be an r-value, so that it cannot be assigned into. David Dick Software Innovations, Inc. [the Software Moving Company(sm)]