From owner-freebsd-hackers Wed Mar 6 2:30:47 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mired.org (dsl-64-192-6-133.telocity.com [64.192.6.133]) by hub.freebsd.org (Postfix) with SMTP id 23E3237B417 for ; Wed, 6 Mar 2002 02:30:36 -0800 (PST) Received: (qmail 71009 invoked by uid 100); 6 Mar 2002 10:30:33 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15493.61384.557931.883967@guru.mired.org> Date: Wed, 6 Mar 2002 04:30:32 -0600 To: obrien@freebsd.org Cc: Mike Meyer , Giorgos Keramidas , hackers@freebsd.org Subject: Re: RFC: style(9) isn't explicit about booleans for testing. In-Reply-To: <20020306005225.A6921@dragon.nuxi.com> References: <20020305201350.GC4820@hades.hell.gr> <20020305155850.A38095@dragon.nuxi.com> <20020306000806.GC6839@hades.hell.gr> <20020305164054.B38095@dragon.nuxi.com> <15493.49923.458997.98416@guru.mired.org> <20020306005225.A6921@dragon.nuxi.com> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ From: "Mike Meyer" X-Delivery-Agent: TMDA/0.48 (Python 2.2 on freebsd4) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG David O'Brien types: > On Wed, Mar 06, 2002 at 01:19:31AM -0600, Mike Meyer wrote: > > David O'Brien types: > > As the original author of the PR, I'll point out that this chagne does > > *not* add rules. It clarifies the wording of a rule that's already > > there. If the rule is wrong, it should be removed. The reason I didn't > > post if for wider review was because it wasn't changing any rules. My > > thanks to Giorgos for moving this PR towards closure. > > I don't think it is clarifying a rule. I think it is in fact adding a > rule. You are extrapolating too much I think. All the rule is trying > to prevent is "if (!strcmp(a,b))" which when read is extremely wrong of > that is actually happening. Ok, I was attempting to clarify a rule, but misinterpreted. Which just reinforces the need for clarifing it. Being an old lisp hand, I'm used to functions that return a value or nil to indicate an error of some kind, and programs that just check the value are SOP. I'll grant that the change Paul suggested makes it clear - the programmer knows when the function is returning an int or not. But it's not clear that it achieves his intent. is char *p; if (p = somerandomfunction(with, args)) { } really less readable than: char *p; if ((p = somerandomfunction(with, args)) != NULL) { } http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message