[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Request For Comments: 3-space indentation style
- From: Dirk Laurie <dirk.laurie@...>
- Date: Mon, 6 Jan 2014 10:33:58 +0200
2014/1/6 William Ahern <william@25thandclement.com>:
> That last argument over the ternary operator totally confused me. I had
> always correctly parsed the precedence of and/or expressions without
> thinking. But after reading that huge thread (or threads) I totally lost all
> confidence. I don't know why. But the mere discussion of it really messed
> with my head. Now whenever I write a complex boolean expression I find
> myself carefully stepping through it, like a child counting pennies
> (centavos?) with his fingers.
And rightly so. The difficulty comes not with `and`/`or`, but with `not`, which
sits near the other end of the precedence pile.
E.g.
inside = x+eps>y and not x-eps>y
is wrong, you need to parenthesize:
inside = x+eps>y and not (x-eps>y)
- References:
- Re: Request For Comments: 3-space indentation style, Tim Hill
- Re: Request For Comments: 3-space indentation style, David Given
- Re: Request For Comments: 3-space indentation style, steve donovan
- Re: Request For Comments: 3-space indentation style, Hisham
- Re: Request For Comments: 3-space indentation style, Jorge
- Re: Request For Comments: 3-space indentation style, Andrew Starks
- Re: Request For Comments: 3-space indentation style, phlnc8
- Re: Request For Comments: 3-space indentation style, William Ahern
- Re: Request For Comments: 3-space indentation style, Coda Highland
- Re: Request For Comments: 3-space indentation style, Andrew Starks
- Re: Request For Comments: 3-space indentation style, William Ahern