# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1298657231 21600 # Node ID d1466d956d179beb2eb65c08b1c07ece9198ad62 # Parent 070214996fba4cd0bfea1e50990ce3c30b52da88 Add a warning description for Matlab-style short-circuiting diff -r 070214996fba -r d1466d956d17 scripts/ChangeLog --- a/scripts/ChangeLog Thu Feb 24 20:22:38 2011 -0500 +++ b/scripts/ChangeLog Fri Feb 25 12:07:11 2011 -0600 @@ -1,3 +1,8 @@ +2011-02-25 Jordi GutiƩrrez Hermoso + + * miscellaneous/warnings_ids.m: Add a warning description for + Matlab-style short-circuiting + 2011-02-24 Ben Abbott * plot/subplot.m: Document using INDEX as a vector. diff -r 070214996fba -r d1466d956d17 scripts/miscellaneous/warning_ids.m --- a/scripts/miscellaneous/warning_ids.m Thu Feb 24 20:22:38 2011 -0500 +++ b/scripts/miscellaneous/warning_ids.m Fri Feb 25 12:07:11 2011 -0600 @@ -188,6 +188,27 @@ ## elicits a warning if the @code{Octave:num-to-str} warning is ## enabled. By default, the @code{Octave:num-to-str} warning is enabled. ## +## @item Octave:possible-matlab-short-circuit-operator +## If the @code{Octave:possible-matlab-short-circuit-operator} warning +## is enabled, Octave will warn about using the not short circuiting +## operators @code{&} and @code{|} inside @code{if} or @code{while} +## conditions. They normally never short circuit, but @sc{Matlab} always +## short circuits if any logical operators are used in a condition. You +## can turn on the option +## +## @example +## @group +## do_braindead_shortcircuit_evaluation(1) +## @end group +## @end example +## +## @noindent +## if you would like to enable this short-circuit evaluation in +## Octave. Note that the @code{&&} and @code{||} operators always short +## circuit in both Octave and @sc{Matlab}, so it's only necessary to +## enable @sc{Matlab}-style short-circuiting it's too arduous to modify +## existing code that relies on this behaviour. +## ## @item Octave:precedence-change ## If the @code{Octave:precedence-change} warning is enabled, Octave ## will warn about possible changes in the meaning of some code due to