David O'Brien <[EMAIL PROTECTED]> types:
> On Wed, Mar 06, 2002 at 01:19:31AM -0600, Mike Meyer wrote:
> > David O'Brien <[EMAIL PROTECTED]> 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) {
}
<mike
--
Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message