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

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

[Octave-bug-tracker] [bug #46571] classdef numel method not consulted fo


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #46571] classdef numel method not consulted for cell-indexed assignment
Date: Fri, 5 Aug 2016 00:46:58 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0

Update of bug #46571 (project octave):

                 Summary: Inconsistency between old and new oop syntax (wrt
subsasgn) => classdef numel method not consulted for cell-indexed assignment

    _______________________________________________________

Follow-up Comment #3:

Dug into this a bit further, and confirmed that the error is that the numel
method is not consulted when Octave is trying to figure out how many values
need to be on the left and right of the assignment operator in an indexing
expression. Since the inconsistency is detected solely through calling the
numel method, the class subsasgn is never even called.

Octave expects types to define a numel function that returns the appropriate
number of elements that would be indexed given an indexing argument. This is
done correctly for old-style classes but not classdef classes.

Therefore, as assignment like `a{'v1'} = ones (10, 1)` is assumed to be
assigning to 2 elements of a cell-array-like thing.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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