Mercurial > hg > octave-nkf
changeset 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 | 32ca4930dec4 |
children | 3ba6e702e6fd |
files | doc/ChangeLog doc/interpreter/expr.txi |
diffstat | 2 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2011-03-27 Rik <octave@nomad.inbox5.com> + + * interpreter/expr.txi: Add do_braindead_shortcircuit_evaluation to + documentation. + 2011-03-26 Rik <octave@nomad.inbox5.com> * interpreter/doccheck/mk_undocumented_list: Add error_text to list
--- 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)