octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #33518] Lots of major and minor compatibility


From: Jordi Gutiérrez Hermoso
Subject: [Octave-bug-tracker] [bug #33518] Lots of major and minor compatibility issues
Date: Sat, 11 Jun 2011 06:14:57 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:2.0) Gecko/20110327 Firefox/4.0 Iceweasel/4.0

Follow-up Comment #2, bug #33518 (project octave):

(oops, typo truncated part of my previous message)

Just a comment about one of these (not sure about the rest of the
things you mention, from a quick random sampling, they all seem like
valid reports assuming they are indeed different from Matlab).

> 2) parsing of &&
> Matlab treats "&" as "&&" (ignore additional inputs) but Octave does
> not

I believe that by "ignore additional inputs" you are referring to
short-circuiting. This is in fact a longstanding Matlab bug (so long
standing, that there is so much code that depends on it that the
Mathworks can't afford to fix it, but we can). It is not correct that
& and && are the same in Matlab. They are only the same inside a
condition but not outside. That is, the parsing rules for


z = a & b ## Does not short circuit


and


if (z = a & b) ## *DOES* short circuit


are different. That this is a bug is obvious because the Matlab
language has another operator, namely &&, that short circuits, but
when they implemented the semantics for &, they forgot to make it not
short circuit when it's inside a condition. In other words, there is
no way in Matlab to avoid short circuiting inside a condition; you
must place the boolean evaluation outside of a condition if you want
the non-short-ciruiting behaviour.

Octave recently enabled support for this Matlab bug in the 3.4.x
series. If you need this bug, enable the


do_braindead_shortcircuit_evaluation


option in Octave.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?33518>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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