From octave-sources-request at bevo dot che dot wisc dot edu Tue Feb 13 23:26:38 2001 Subject: cell array patch From: "John W. Eaton" To: Paul Kienzle , octave-sources@bevo.che.wisc.edu Date: Tue, 13 Feb 2001 23:26:34 -0600 On 13-Feb-2001, I wrote: | On 5-Nov-2000, Paul Kienzle wrote: | | | While implementing assignment, I noticed that =[] is an operator in | | Matlab. That is, "x(i)=[];" deletes the ith element of x, but "y=[]; | | x(i)=y;" gives a non-conformant arguments error. Putting deletion in | | the parse.y and separating assignment from deletion would make the code | | in liboctave somewhat cleaner, and fix a hack that I needed to implement | | cell array deletion. | | I decided to see how difficult this might be. It *seems* that it should | be relatively easy, but I believe that it is not, unless you are | willing to give up the idea that an assignment should produce a | value. In other words, you would not be able to write | | x = y = z = []; I may have spoken too soon. Giving up assignment as a value (even in the case of assignment of []) may not be required, and it may not be terribly difficult (by recognizing an empty matrix, and tagging the expression as such, then handling it as a special case when the parser builds the assignment tree). Sorry to clutter this list with non-source nonsense. 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 -------------------------------------------------------------