Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #28335

Re: verifying precedence

From Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: verifying precedence
Date 2014-05-01 10:49 -0500
Organization A noiseless patient Spider
Message-ID <ljtqdt$oas$1@dont-email.me> (permalink)
References <ivc4m95b309smq7g0pkes96cfpmdfsmj6q@4ax.com> <AfOdnQTUOv31pf_OnZ2dnUVZ8tednZ2d@giganews.com> <ljtpkp$isn$1@dont-email.me> <1qwlhphwzsn5o.19fl7m2msrabe.dlg@40tude.net>

Show all headers | View raw


On 5/1/2014 10:40 AM, Joerg Meier wrote:
> On Thu, 01 May 2014 10:35:34 -0500, Joshua Cranmer ������ wrote:

^^ Ha, my use of a non-BMP character caught out a newsreader! I'm 
guessing it's trying to encode UTF-8 as CESU-8 instead from the number 
of characters?

>> That's not quite the right rules, but probably because it's ignoring
>> half the operators in the first place.
>
> I believe that's the point. It's saying not to bother with the rules of the
> rest and to just use parenthesis instead, and I'm inclined to agree. Even
> if you perfectly know operator precedence, it's still hard to read a
> complex statements without parenthesis and intuitively grasp what happens.

If you took its recommendations strictly, it would advise you to say:
x = ((a + 5) == (b + c));

I was pointing out that it's missing the implicit levels for the 
"obvious" operators. In truth, the complexity of the situation is with 
the shift and bitwise operators in comparison to everything else and to 
themselves. (And, arguably, comparison operators to themselves: a >= b 
== c <= d is something I would advocate parenthesizing).


-- 
Beware of bugs in the above code; I have only proved it correct, not 
tried it. -- Donald E. Knuth

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

verifying precedence Roedy Green <see_website@mindprod.com.invalid> - 2014-05-01 04:50 -0700
  Re: verifying precedence leif.roar@invalid.com (Leif Roar Moldskred) - 2014-05-01 07:04 -0500
    Re: verifying precedence Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2014-05-01 10:35 -0500
      Re: verifying precedence Joerg Meier <joergmmeier@arcor.de> - 2014-05-01 17:40 +0200
        Re: verifying precedence Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2014-05-01 10:49 -0500
          Re: verifying precedence Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2014-05-01 17:05 -0500
            Re: verifying precedence Gene Wirchenko <genew@telus.net> - 2014-05-02 10:22 -0700
            Re: verifying precedence "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2014-05-04 10:53 +0100
              Re: verifying precedence Simon Lewis <simonlewis2001@gmail.com> - 2014-05-04 13:23 +0200
          Re: verifying precedence Arne Vajhøj <arne@vajhoej.dk> - 2014-05-01 18:51 -0400
          Re: verifying precedence Arne Vajhøj <arne@vajhoej.dk> - 2014-05-01 19:00 -0400
          Re: verifying precedence Roedy Green <see_website@mindprod.com.invalid> - 2014-05-01 17:48 -0700
          Re: verifying precedence Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-05-02 13:29 -0400
      Re: verifying precedence Arne Vajhøj <arne@vajhoej.dk> - 2014-05-01 18:50 -0400
        Re: verifying precedence Arne Vajhøj <arne@vajhoej.dk> - 2014-05-01 19:18 -0400
    Re: verifying precedence Roedy Green <see_website@mindprod.com.invalid> - 2014-05-01 17:46 -0700
      Re: verifying precedence Arne Vajhøj <arne@vajhoej.dk> - 2014-05-01 21:27 -0400

csiph-web