octave-maintainers
[Top][All Lists]
Advanced

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

Re: Question about short circuit operators


From: Jordi Gutiérrez Hermoso
Subject: Re: Question about short circuit operators
Date: Fri, 25 Feb 2011 08:22:29 -0600

I think the Matlab warning about short circuit operators is warranted.
Matlab's behaviour is extremely weird and in effect makes it
impossible to not short circuit in conditions. Octave clearly
separates & and && plus | and || for short and not short-circuiting
operations. Since this affects semantics, if you're writing code that
relies on these weird semantics you should be warned about it. If you
don't like the warning, put

     warning off Octave:possible-matlab-short-circuit-operator

in your .octaverc

I just noticed that the warning_ids function didn't list this ID. I
had to go digging in src/pt-binop.h for the warning id. That could use
a patch.

- Jordi G. H.


reply via email to

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