Transcript handling of OR and AND expressions

Dan Shafer revdan at danshafer.com
Wed Feb 18 12:15:10 EST 2004


This is, relatively speaking at least, how all of the major programming 
languages work. There's even a name for it. I think it might be called 
something like "lazy" Boolean evaluation.

In any case, while Jim is right that this can be an issue if you use 
expressions with side effects, the professional coders I've discussed 
this with -- and there haven't been that many -- have essentially said, 
"Don't include expressions in Boolean logic statements if thos 
expressions have side effects. Rather, evaluate the expressions outside 
the Boolean logic statement."

On Jan 26, 2004, at 9:30 AM, Mark Wieder wrote:

> Jim-
>
> Monday, January 26, 2004, 4:16:36 AM, you wrote:
>
> JL> The docs don't say AFAIK, but I always wondered, so just now I 
> tested
> JL> this. It's a good thing to know about sometimes.
>
> Well, it is indeed good to know about, but I'd be *very* wary about
> relying on behavior that isn't documented. You run a good chance of
> your code breaking for no apparent reason in a future rev release.
>
> OTOH, I *like* this behavior a lot, and it would be good to get a
> ruling from runrev on whether this is by design (and therefore
> destined to be in the docs).
>
> -- 
> -Mark Wieder
>  mwieder at ahsoftware.net
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list