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

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

[Octave-bug-tracker] [bug #48867] delete elements from array with indire


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #48867] delete elements from array with indirect empty matrix
Date: Thu, 25 Aug 2016 00:30:51 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

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

I'm pretty sure this is a bit of a kluge to allow "x(idx) = []" to work for
classes the same way as for ordinary built-in objects.  For objects, the
syntax is converted to a call to the subsasgn method for the class (if it is
defined).  Because [] is an empty double array, it makes sense to limit it to
this type, and I assume, also a 0x0 array, not 0x1, or any other shape of
empty array.  But because the literal [] empty array loses its special status
when it is assigned to a variable or passed to a function, subsasgn must
accept "zeros(0,0)" as well.  And, because subsasgn can work for built-in
types, it must also work this way for them.

Amro, can you verify that zeros(0,0) works but zeros(0,0,1,0) does not?

Mike, your patch should be fine, but if I'm right about the 0x0 thing, then it
should probably use is_zero_by_zero instead of is_empty.  I just fixed
is_zero_by_zero so that it requires exactly two dimensions and that both are
0.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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