is it true ?
Alex Tweedly
alex at tweedly.net
Wed May 18 13:59:36 EDT 2005
jbv wrote:
>Hi again,
>
>I vaguely remember reading from someone on this very list that in case
>of a complex conditional statement like :
> if offset(a,d)>0 and w1>0 and w2=w1+1 and offset(b,d)>0 and w3>0 and
>w4=w3+1 then
>Rev would drop the evaluation as soon as a false is encountered, hence
>speeding up
>the execution of the script...
>
>Is that true, or did I dream ?
>
>
Yes, it's true - quoted from Scott Raney on the MC list; conditional
evaluation ceases as soon as the result can be determined.
This has consequences not just for the speed, but also for the
predictability of results from things like using variables/fields that
may not exist, calling functions with side-effects, etc. and therefore
is effectively part of the definition of correct operation of the
language (i.e. you can assume it will remain true).
I don't know whether his statement covered switch condition evaluation
or not - I would expect it does, but would verify that by testing before
depending on it.
--
Alex Tweedly http://www.tweedly.net
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.11 - Release Date: 16/05/2005
More information about the use-livecode
mailing list