1. Re: Short Circuiting
- Posted by Lmailles at AOL.COM
Jun 22, 1998
-
Last edited Jun 23, 1998
As was discussed a while back I planned to add short circuiting to my euphoria
optimiser (which should hopefully get written this summer). This will however
be for optimisation purposes rather than safe coding.
In brief, it puts all functions which might *need* to be called in the first
if statement and then nests everything else in the order it was supplied
eg
if a=1 and foo() and length(s)>0 and bar() and z<-6 then
becomes
if foo() and bar() then
if a=1 then
if length(s)>0 then --length() is built-in so optimiser knows it has no
effect on the world
if z<-6 then
end if
end if
end if
end if
If you wish to do short-circuiting for error-avoiding purposes I (again) agree
with Ralf :
use
if then if then if then
end if end if end if
Daniel