Re: Fundamental question

From: Keith Thompson (kst-u_at_mib.org)
Date: 06/05/04


Date: Sat, 05 Jun 2004 21:37:26 GMT

Guillaume <grsNOSPAM@NO-SPAMmail.com> writes:
> >>Binary logic operators have the same priority, as far as I know.
> > [...]
> > You're mistaken. Please consult a book or other reference before
>
> Thanks. I don't need to, though. I've been using C for more than 10
> years in professional settings. ;-)

Then why do you still seem to believe that "[b]inary logic operators
have the same priority"? You can quibble about the distinction
between "priority" and "precedence" (though if you meant to make such
a distinction you should have made it clear in the first place).

The || and && operators have different precedence in C. Any statement
to the contrary is simply incorrect. Any C programmer needs to know
this, or at least needs to be recognize the need to look it up when
necessary.

[...]
> The aforementioned expression was deterministic, but highly
> unreadable. This is the point I was making.

That was one of the points you made, and I (mostly) agree with it.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
We must do something.  This is something.  Therefore, we must do this.


Relevant Pages

  • issues with SO_PRIORITY and IP_TOS
    ... tos field to generate the packet priority value. ... backwards compatible with the old precedence field. ... for vlan priority tagging there are only 3 bits available. ... The second call sets the proper socket priority so ...
    (Linux-Kernel)
  • Re: Fundamental question
    ... Please consult a book or other reference before ... > in C, but it's not equivalent to algebraic priority, because ... The precedence is syntactic, ... > if a or b have side-effects. ...
    (comp.lang.c)
  • Re: Penny stamp principle
    ... have a different priority from an ordinary subtraction operation; ... unary plus and minus have ... does NOT have that distinction. ...
    (comp.sys.acorn.programmer)
  • Re: Fundamental question
    ... Guillaume writes: ... This does not add up to different priority ... precedence, but I don't think you are. ... short-circuit semantics, ...
    (comp.lang.c)