On Mon, 13 Aug 2018, Henrique Andrade wrote:
Em 13 de agosto de 2018, Allin escreveu:
(...)
> Anyway, if I don't get any substantial support for this notion I'll
> quietly give it up.
I don't know if this can be considered as substantial [:)], but other
languages support decrementing:
Python:
for i in range(10,0,-1):
print i
R
for (i in 10:1) {
print(i)
}
Julia:
for i in 10:-1:0
println(i)
end
Matlab:
for k=10:-1:1
disp(i)
end
Thanks, that's useful information. It suggests that if wanted to
support decrement in relation to our simple "loop i=start..stop" we
could perhaps add a third (optional) syntactic element instead of an
option flag.
But... we do have the fully flexible C-style "for (...)" available
-- with arbitrary increment/decrement and any termination condition
you like -- and adding a third term to the simple variant would seem
to imply that we're open to any increment or decrement in that
context, which is not what I'm (sorta) proposing. So maybe despite
this useful information we're really back to square one: does the
putative gain in transparency outweight the redundancy?
Allin