Using gnuplot version 5.0.4, the command do for [i=1:3] {}; print i prints "3", whereas current CVS head prints "4". Is that change intended? I did not find anything specified in the docs, so this change does not really qualify as bug.
I guess it is a side-effect of this bugfix, but I have not gone back to test that guess.
2016-10-26 Thomas Sefzick t.sefzick@fz-juelich.de
* src/plot2d.c: Never decrease value of highest_iteration.
Avoids missed plots when a plot command contains more than one
iteration and the last iteration is shorter than the others.
Bug #1871
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As of today, in 5.1 the scope of an iteration variable is strictly limited to the iterated clause. Its value after iteration finishes is the same as it was prior to iteration, possibly not defined at all. This is now documented under "help iteration".
This change does not back-port cleanly to version 5.0 so at least for now the value of the iteration variable after the iteration completes is not guaranteed to be anything in particular in version 5.0.
I guess it is a side-effect of this bugfix, but I have not gone back to test that guess.
2016-10-26 Thomas Sefzick t.sefzick@fz-juelich.de
* src/plot2d.c: Never decrease value of highest_iteration.
Avoids missed plots when a plot command contains more than one
iteration and the last iteration is shorter than the others.
Bug #1871
As of today, in 5.1 the scope of an iteration variable is strictly limited to the iterated clause. Its value after iteration finishes is the same as it was prior to iteration, possibly not defined at all. This is now documented under "help iteration".
This change does not back-port cleanly to version 5.0 so at least for now the value of the iteration variable after the iteration completes is not guaranteed to be anything in particular in version 5.0.
See also Bug #1755
https://sourceforge.net/p/gnuplot/bugs/1755/
That one may be amenable to the same fix
Last edit: Ethan Merritt 2017-02-06
This change seems to not have made it into the 5.2 release notes.