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

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

[Octave-bug-tracker] [bug #47755] Access to object arrays


From: Peter Corke
Subject: [Octave-bug-tracker] [bug #47755] Access to object arrays
Date: Sat, 13 Apr 2019 23:10:39 -0400 (EDT)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Safari/605.1.15

Follow-up Comment #5, bug #47755 (project octave):

Using Octave 5.1 these issues are still present, but this bug seems to be
dormant.

In MATLAB these are all identical:

myprop(a)
a.myprop
a.myprop()

and the object array a is passed to the method myprop().

In Octave each behaves differently:

myprop(a) is called once and passed the object array a
a.myprop is called on every element of a, the return value is the
concatenation of the return value from every call to my prop
a.myprop() always gives an error

error: can't perform indexing operation on array of my class objects

but not clear what it is trying to index. If an argument is given inside the
parentheses it is passed to the method, so it's not using as an index for a. 
Octave certainly can perform indexing operations on this kind of object array,
just not in this context.

Are these different behaviours desired/documented?  I'm trying to make some
code as compatible as possible between MATLAB and Octave, and it'd be good to
know where I stand.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?47755>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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