[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #31287] Certain assignments of empty arrays gi
John W. Eaton
[Octave-bug-tracker] [bug #31287] Certain assignments of empty arrays give errors (Matlab incompatibility)
Wed, 12 Jan 2011 19:43:53 +0000
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:220.127.116.11) Gecko/20101028 Iceweasel/3.5.15 (like Firefox/3.5.15)
Follow-up Comment #13, bug #31287 (project octave):
Are you sure the rules have to be this complex?
For example, for this case
x = ones (2, 2, 2)
x(false, ) = 
if we look at what the result is just for the index expression on the LHS, we
would get (0x0). I think this is allowed because any time a variable is
indexed, the extra dimensions are combined until there are as many dimensions
as indices. So in the above, it is as if we are really indexing a 2x4 array,
not a 2x2x2 array. Would it help if we first just applied that rule to the
LHS and then proceeded as we do now? Or are we already doing that?
It would be interesting to me to see what Octave produces for all these test
cases just for the index expression on the LHS. Does the dimension of that
result match the dimension of the value on the RHS?
If so, then it would seem to me that we are not applying the same rules to
indexing expressions when they appear on the LHS of an assignment as we are
when they are not part of an assignment expression.
If not, are they at least both empty?
Maybe we simply need to apply the same rules for indexing the LHS as we do
for indexing expressions when they are not part of an assignment expression
before testing to see whether the assignment conforms?
Reply to this item at:
Message sent via/by Savannah