Re: feature request (&&/|| shortcut)

2011-01-06 Thread Ondrej Zajicek
On Sun, Jan 02, 2011 at 05:29:08PM +0100, Arnold Nipper wrote:
> It looks like BIRD logical && operator is not doing a shortcut. I.e even
> if you have s.th. like
> 
> if 0 && $some_complex_expression then ...
> if 1 || $some_complex_expression then ...
> 
> BIRD will try to evaluate $some_complex_expression. Would really be
> great if you could short cut this as you may have situations where the
> first expression already is false while trying to evaluate 2nd
> expression may lead to run time errors in that case. In this case you
> would have to use a nested "if first_expression then if 2nd_expression
> then" instead of "if first_expression && 2nd_expression then"

You are right, short-circuit evaluation is probably a better behavior.
I will look at that and probably change that.

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santi...@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."


signature.asc
Description: Digital signature


Re: feature request (&&/|| shortcut)

2011-01-05 Thread Arnold Nipper
on 02.01.2011 17:29 Arnold Nipper wrote:

> First of all a Happy New Year and a prosperous and successfull 2011 to
> everyone! May all your wishes come through!
> 
> 
> It looks like BIRD logical && operator is not doing a shortcut. I.e even
> if you have s.th. like
> 
> if 0 && $some_complex_expression then ...
> if 1 || $some_complex_expression then ...
> 
> BIRD will try to evaluate $some_complex_expression. Would really be
> great if you could short cut this as you may have situations where the
> first expression already is false while trying to evaluate 2nd
> expression may lead to run time errors in that case. In this case you
> would have to use a nested "if first_expression then if 2nd_expression
> then" instead of "if first_expression && 2nd_expression then"
> 

no one bites?



Best regards,
Arnold
-- 
Arnold Nipper / nIPper consulting, Sandhausen, Germany
email: arn...@nipper.de   phone: +49 6224 9259 299
mobile: +49 152 53717690  fax:   +49 6224 9259 333



signature.asc
Description: OpenPGP digital signature


feature request (&&/|| shortcut)

2011-01-02 Thread Arnold Nipper
First of all a Happy New Year and a prosperous and successfull 2011 to
everyone! May all your wishes come through!


It looks like BIRD logical && operator is not doing a shortcut. I.e even
if you have s.th. like

if 0 && $some_complex_expression then ...
if 1 || $some_complex_expression then ...

BIRD will try to evaluate $some_complex_expression. Would really be
great if you could short cut this as you may have situations where the
first expression already is false while trying to evaluate 2nd
expression may lead to run time errors in that case. In this case you
would have to use a nested "if first_expression then if 2nd_expression
then" instead of "if first_expression && 2nd_expression then"


TIA and best regards,
Arnold
-- 
Arnold Nipper / nIPper consulting, Sandhausen, Germany
email: arn...@nipper.de   phone: +49 6224 9259 299
mobile: +49 152 53717690  fax:   +49 6224 9259 333



signature.asc
Description: OpenPGP digital signature