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

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

[Octave-bug-tracker] [bug #50887] The find function is faulty


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #50887] The find function is faulty
Date: Wed, 11 Oct 2017 16:35:19 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #4, bug #50887 (project octave):

The reason that


find (A = B)


fails in Matlab is that assignments are not expressions, so they don't return
values.  This also means that you can't do things like


C = B = A


In Octave, assignments return values, so that they can be chained.  It also
means that assignments can be used anywhere an expression is valid, like in
the argument list to a function.  I think this is a useful feature.

There is nothing to fix in the find function because all it sees is a matrix. 
It doesn't know that the value it is working on is an assignment.

Perhaps we could have an optional warning about assignments that appear in
expression contexts.  Then you could make that an error and get Matlab
compatibility, but we'd have to be able to disable it for Octave code since it
is a widely used feature.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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