From bug-request at octave dot org Sat Jan 7 00:25:54 2006 Subject: Possible Parsing Bug From: "John W. Eaton" To: Bill Denney Cc: bugs at octave dot org Date: Sat, 7 Jan 2006 01:25:48 -0500 On 7-Jan-2006, Bill Denney wrote: | I was just typing some code in 2.1.72 on cygwin when I did something that | I was surprised about. The following code worked correctly (i.e. it | returned a 6) when I thought that it should have failed parsing, and | similar code fails in matlab 7SP2. | | The code is | octave:1> localtime(time).year-100 | ans = 6 | | The reason that I thought that this may be a bug is because I'm evaluating | a field in a structure returned from a function. Normally, I would have | expected to have to set it to a variable. Similar things work for arrays: | | octave:1> funtion a = testa(x);a = 1:x;endfunction | octave:2> testa(5)(3) | ans = 3 | | I just wanted to check if this was a bug or a feature. It's a feature. 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 -------------------------------------------------------------