Re: Help improve program for parsing simple rules
- From: Paul McGuire <ptmcg@xxxxxxxxxxxxx>
- Date: Fri, 17 Apr 2009 12:01:26 -0700 (PDT)
On Apr 17, 1:26 pm, Aaron Brady <castiro...@xxxxxxxxx> wrote:
Hi, not to offend; I don't know your background.
Courtesy on Usenet!!! I'm going to go buy a lottery ticket!
Not to worry, I'm a big boy. People have even called my baby ugly,
and I manage to keep my blood pressure under control.
One thing I like
about Python is it and the docs are careful about short-circuiting
conditions. ISTR that C left some of those details up to the compiler
at one point.
def f():
... print( 'in f' )
... return 10
...>>> 0<f()<20
in f
True>>> 0<f() and f()<20
in f
in f
True
Therefore, if op{n} has side effects, 'op1 operator1 op2 AND op2
operator2 op3' is not equivalent to 'op1 optor1 op2 optor2 op3'.
Interesting point, but I don't remember that "A < B < C" is valid C
syntax, are you perhaps thinking of a different language?
By luck, my implementation of EvalComparisonOp.eval does in fact
capture the post-eval value of op2, so that if its evaluation caused
any side effects, they would not be repeated.
-- Paul
.
- Follow-Ups:
- Re: Help improve program for parsing simple rules
- From: Aaron Brady
- Re: Help improve program for parsing simple rules
- References:
- Re: Help improve program for parsing simple rules
- From: Paul McGuire
- Re: Help improve program for parsing simple rules
- From: John Machin
- Re: Help improve program for parsing simple rules
- From: Paul McGuire
- Re: Help improve program for parsing simple rules
- From: Aaron Brady
- Re: Help improve program for parsing simple rules
- Prev by Date: Re: QT , Wxwidgets are not just UI framework ?
- Next by Date: Re: question about xrange performance
- Previous by thread: Re: Help improve program for parsing simple rules
- Next by thread: Re: Help improve program for parsing simple rules
- Index(es):
Relevant Pages
|