Mercurial > jwe > octave
comparison 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 |
comparison
equal
deleted
inserted
replaced
12542:32ca4930dec4 | 12543:f60f755ebfe4 |
---|---|
905 @noindent | 905 @noindent |
906 would result in an error if @code{f} were called with one or two | 906 would result in an error if @code{f} were called with one or two |
907 arguments because Octave would be forced to try to evaluate both of the | 907 arguments because Octave would be forced to try to evaluate both of the |
908 operands for the operator @samp{&}. | 908 operands for the operator @samp{&}. |
909 | 909 |
910 The ternary operator (?:) is not supported in Octave. If short-circuiting is | 910 @sc{matlab} has special behavior that allows the operators @samp{&} and |
911 not important, it can be replaced by the @code{ifelse} function. | 911 @samp{|} to short-circuit when used in the truth expression for @code{if} and |
912 @code{while} statements. The Octave parser may be instructed to behave in the | |
913 same manner, but it's use is strongly discouraged. | |
914 | |
915 @DOCSTRING(do_braindead_shortcircuit_evaluation) | |
916 | |
917 Finally, the ternary operator (?:) is not supported in Octave. If | |
918 short-circuiting is not important, it can be replaced by the @code{ifelse} | |
919 function. | |
912 | 920 |
913 @DOCSTRING(merge) | 921 @DOCSTRING(merge) |
914 | 922 |
915 @node Assignment Ops | 923 @node Assignment Ops |
916 @section Assignment Expressions | 924 @section Assignment Expressions |