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

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

[Octave-bug-tracker] [bug #62405] Out of Bound(OOB) on subsindex()


From: Glite
Subject: [Octave-bug-tracker] [bug #62405] Out of Bound(OOB) on subsindex()
Date: Tue, 3 May 2022 08:03:22 -0400 (EDT)

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

I know your input_container(b) means method call. But Octave will interpret
input_container(b) or input_container.b as a indexing to object. 
To call a method in @+ClassName class, I have to write b(input_container).
So maybe this is the real bug?

[comment #3 comment #3:]
> From the documentation of subsindex:
>
https://octave.org/doc/v7.1.0/Defining-Indexing-And-Indexed-Assignment.html#index-subsindex
> 
> > When obj is a class object defined with a class constructor, then
subsindex is the overloading method that allows the conversion of this class
object to a valid indexing vector.
> 
> If I understand that correctly, `subsindex` converts the object to an
indexing vector (to be able to index *into* something else). And that seems to
be what is happening (and working ass expected) in your examples.
> 
> From what you are describing, I guess that you would like to index into the
object with an already existing indexing vector. Is that correct? In that
case, you might want to overload `subsref`:
>
https://octave.org/doc/v7.1.0/Defining-Indexing-And-Indexed-Assignment.html#index-subsref
> 
> And index into your object like, e.g., `input_container(b)` (so, the other
way round).


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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