From bug-request at octave dot org Wed Feb 2 15:54:02 2005 Subject: Should be able to say 'for (k=1:N)' From: Julius Smith To: bug at octave dot org Date: Wed, 2 Feb 2005 15:45:51 -0600 The octave session below illustrates a small parser inconsistency (see fourth command line) that tends to bite C programmers. :-) > octave GNU Octave, version 2.1.64 (i686-pc-linux-gnu). ... octave:1> 1:4 ans = 1 2 3 4 octave:2> (1:4) ans = 1 2 3 4 octave:3> (k=1:4) k = 1 2 3 4 octave:4> for (k=1:4), k, end parse error: syntax error >>> for (k=1:4), k, end ^ octave:4> for k=1:4, k, end k = 1 k = 2 k = 3 k = 4 octave:5> ------------------------------------------------------------- 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 -------------------------------------------------------------