octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: short-circuit ops


From: Ed Meyer
Subject: Re: short-circuit ops
Date: Sat, 29 Sep 2012 19:45:14 -0700



On Sat, Sep 29, 2012 at 7:09 PM, Júlio Hoffimann <address@hidden> wrote:
Hi Julio,
I understand that I can switch off the warning, but what I'm saying is that according
to matlab's documentation they don't do what this message claims, namely short-circuit
single-character boolean ops:

http://www.mathworks.com/help/matlab/ref/logicaloperatorselementwise.html

I think the documentation is consistent, according to your link, MATLAB will never short-circuit & or | except when inside if/while expressions.

If i understood correctly, these operators *never* short-circuit in Octave, unless you ask it for:

do_braindead_shortcircuit_evaluation (1) % be weird like MATLAB

Since short-circuit can be achieved with other operators safely (&& and ||) in both interpreters, they are preferred.

Regards,
Júlio.

oops, looks like I didn't read the matlab doc far enough.  Braindead is right.
I'll see if I can get the instructor to replace his with my double-char version.
Thanks Julio

--
Ed Meyer


reply via email to

[Prev in Thread] Current Thread [Next in Thread]