Re: Short-circuit warning

new topic     » goto parent     » topic index » view thread      » older message » newer message

Derek Parnell wrote:
> 
> Andy Drummond wrote:
> > 
> > When I first used Euphoria the docs DID describe the short-circuiting
> > process.
> > It was very clear, and made coding easier with things like:
> > }}}
<eucode>
> >     if atom(res) or length(res)=0 or res[1]='+' then
> >         do something
> >     end if
> > </eucode>
{{{

> > To do that with three nested if statements would be silly.
> 
> By the way, it used to be that short ciruiting was significantly slower than
> coding multiple IFs. I don't know if that situation has changed or not.
> 
> 
I never tested it but I always assumed that it had to be quicker; in effect the
short-circuit is just a paraphrase for the multiple-if method. Strange! That's
one reason I wanted it kept - though I gather there is no suggestion that it
should
go. I evidently misunderstood what some people were saying!

> -- 
> Derek Parnell
> Melbourne, Australia
> Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu