Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!usc!apple!tahoe!jimi!lowell.cs.unlv.edu!grover From: grover@lowell.cs.unlv.edu (Kevin Grover) Newsgroups: comp.lang.c Subject: Re: When do you use "if ( a = b )"? (was Re: Funny mistake) Message-ID: <1991Mar19.192416.13756@unlv.edu> Date: 19 Mar 91 19:24:16 GMT References: <8148@rsiatl.Dixie.Com> <15481@smoke.brl.mil> <775@camco.Celestial.COM> <65837@eerie.acsu.Buffalo.EDU> <1991Mar18.195351.11985@unlv.edu> <357@ptcburp.ptcbu.oz.au> Sender: news@unlv.edu (News User) Reply-To: grover@lowell.cs.unlv.edu (Kevin Grover) Organization: UNLV Computer Science and Electrical Engineering Lines: 37 michi@ptcburp.ptcbu.oz.au (Michael Henning) writes: ) grover@sonny-boy.cs.unlv.edu (Kevin Grover) writes: ) ) [ Stuff deleted I entirely agree with ] ) ) >Also, if you get bitten but this bug often, try something like ) ) > #define EQU == ) ) > if ( a EQU b) ) ) >Instead of depending upon remembering to use '==' when you need to. ) ) NO, NO, NO ! Please don't do this. [ misc. flame deleted ...] ) And besides, are you going to change every occurrence of == to EQU in every ) piece of code you will ever maintain ? I don't think that you would make ) many friends that way, a lot of software maintenance relies on noise-free ) diff listings. Just so you know, I agree completely. I have never, and will never use such a construct. I merely thought if it on the fly, as a means to help those suffer from that problem ( using = in place of ==) get alone with as little difficulty as possible. However, I do not understand why you are so against such a use of define. I agree that it might be a pain on a continual basis, but any person who expects to use C regularly will (hopefully) discover this, and finally learns that using = in a test is very usefull, or possibly quite using C. -- +-------------------------------------------------+----------------------+ | Kevin Grover UNLV Computer Science | Home of the | | grover@cs.unlv.edu Las Vegas, Nevada | Running REBELS | +-------------------------------------------------+----------------------+