From bug-octave-request at octave dot org Thu Apr 8 15:17:26 2004 Subject: Re: Error in ND Array Creation From: "John W. Eaton" To: Quentin Spencer Cc: David Bateman , octave bug mailing list Date: Thu, 8 Apr 2004 16:16:26 -0500 On 5-Apr-2004, Quentin Spencer wrote: | >Does it make sense to index into a non-existent object with dimension on | >both sides taht don't agree . Matlab R12 (the last I have access to) | >crashes also like this | | It works in Matlab R13. As to whether it makes sense or not, that's | another question... Right. Well, I don't think I understand the rules of assignments like a(1,1,:) = [1,2] a(:,1,:) = [1,2] a(:,:,:) = [1,2] well enough to get it right. The code in the assignN function in liboctave/Array.cc is already quite complex so I think I would be likely to break things that already work if I try to fix the problem you've reported. That the code is so complicated already makes me think that either the rules are too complex (a language design issue) or we don't understand them well enough to see how they can be described in a simple way. If someone could try to express the *complete* set of rules for indexed array assignments in a simple way, that would help a lot. This is yet another example of where we could use a language standard, but I doubt that is going to happen. jwe ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------