Mercurial > hg > octave-lyh
diff doc/interpreter/expr.txi @ 12543:f60f755ebfe4
Add do_braindead_shortcircuit_evaluation to documentation.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 27 Mar 2011 20:32:29 -0700 |
parents | 6b6e9051ecb8 |
children | 3ba6e702e6fd |
line wrap: on
line diff
--- a/doc/interpreter/expr.txi +++ b/doc/interpreter/expr.txi @@ -907,8 +907,16 @@ arguments because Octave would be forced to try to evaluate both of the operands for the operator @samp{&}. -The ternary operator (?:) is not supported in Octave. If short-circuiting is -not important, it can be replaced by the @code{ifelse} function. +@sc{matlab} has special behavior that allows the operators @samp{&} and +@samp{|} to short-circuit when used in the truth expression for @code{if} and +@code{while} statements. The Octave parser may be instructed to behave in the +same manner, but it's use is strongly discouraged. + +@DOCSTRING(do_braindead_shortcircuit_evaluation) + +Finally, the ternary operator (?:) is not supported in Octave. If +short-circuiting is not important, it can be replaced by the @code{ifelse} +function. @DOCSTRING(merge)