octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stupid Matlab-style short-circuit behavior for | and &


From: Jaroslav Hajek
Subject: Re: stupid Matlab-style short-circuit behavior for | and &
Date: Sat, 9 Oct 2010 20:41:20 +0200

On Sat, Oct 9, 2010 at 5:57 PM, John W. Eaton <address@hidden> wrote:
> On  9-Oct-2010, Ben Abbott wrote:
>
> |
> | On Oct 9, 2010, at 5:48 AM, Søren Hauberg wrote:
> |
> | > fre, 08 10 2010 kl. 16:36 -0400, skrev John W. Eaton:
> | >> On  8-Oct-2010, Jaroslav Hajek wrote:
> | >>
> | >> | No, apparently I just didn't realize how stupid this is :) Your first
> | >> | solution was probably fine.
> | >>
> | >> OK, I checked it in.  You can turn the feature on or off with
> | >>
> | >>  do_braindead_shortcircuit_evaluation
> | >>
> | >> By default there is a warning at parse time if an & or | expression is
> | >> found in the condition of a WHILE of IF statement.  You can disable
> | >> the warning with
> | >>
> | >>  warning off Octave:possible-matlab-short-circuit-operator
> | >>
> | >> If you start Octave with --traditional the feature is enabled and the
> | >> warning is disabled.
> | >
> | > So, does that mean we do the brain-dead (i.e. Matlab compatible)
> | > evaluation by default or is it something you have to manually enable?
> | >
> | > Søren
> |
> | After starting Octave with no options ...
> |
> | octave:1> which do_braindead_shortcircuit_evaluation
> | `do_braindead_shortcircuit_evaluation' is a built-in function
> |
> | octave:2> do_braindead_shortcircuit_evaluation
> | ans = 0
> |
> | It is off by default.
>
> Right, and the warning is on by default because I would like to steer
> people toward using || and && for logical operations, and also with
> the option of turning on the stupid Matlab-compatible feature, we need
> to know when it might affect our code.  With the last two changesets I
> have checked in, I think I have eliminated all cases in the Octave
> sources.
>
> jwe
>
>

I'm glad that you can make some money by maintaining Octave, but at
the same time it's sad that you have to do so by implementing shitty
features that we all used to laugh at a year ago. Doesn't put Octave's
future into a bright perspective, huh? Sorry if I just made it a
little darker :(



reply via email to

[Prev in Thread] Current Thread [Next in Thread]