octave-maintainers
[Top][All Lists]
Advanced

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

Re: short-circuit ops


From: Júlio Hoffimann
Subject: Re: short-circuit ops
Date: Sat, 29 Sep 2012 23:09:56 -0300

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.

reply via email to

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