On Mon, 13 Aug 2018, Allin Cottrell wrote:
You can create such a "backwards" loop at present, either
using the more
flexible (but more cumbersome) "for" construct or by adding an auxiliary
index, but it would be convenient to have the decrement case handled
automatically.
Sorry to point out the obvious, but in many cases you don't need a for
loop at all, just a temporary variable, as in
loop i = 1 .. n
j = n - i + 1
[ ... whatever ... ]
endloop
or the countless variants on the theme.
On the other hand, I don't think a double loop like
loop i = 1 .. n
loop j = i+1 .. n
...
endloop
endloop
should be considered buggy code: you may legitimately want to process the
lower triangle of a matrix, for example.
Given the potential for breakage, I'm not a great fan of the --decrement
option, especially considering that the alternative is relatively
painless in all the examples I can think of. Maybe I'm missing something?
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------