# HG changeset patch # User Rik # Date 1301283149 25200 # Node ID f60f755ebfe493d0950845dd90e95ebdbb787be1 # Parent 32ca4930dec400248f16bf36a20dffadb952488a Add do_braindead_shortcircuit_evaluation to documentation. diff -r 32ca4930dec4 -r f60f755ebfe4 doc/ChangeLog --- a/doc/ChangeLog Sat Mar 26 21:15:48 2011 -0700 +++ b/doc/ChangeLog Sun Mar 27 20:32:29 2011 -0700 @@ -1,3 +1,8 @@ +2011-03-27 Rik + + * interpreter/expr.txi: Add do_braindead_shortcircuit_evaluation to + documentation. + 2011-03-26 Rik * interpreter/doccheck/mk_undocumented_list: Add error_text to list diff -r 32ca4930dec4 -r f60f755ebfe4 doc/interpreter/expr.txi --- a/doc/interpreter/expr.txi Sat Mar 26 21:15:48 2011 -0700 +++ b/doc/interpreter/expr.txi Sun Mar 27 20:32:29 2011 -0700 @@ -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)