>> "Akim" == Akim Demaille
<akim(a)lrde.epita.fr> writes:
I would like to suggest that for-from loops be sugar
for for-in
loops.
I would like to suggest the possibility to use ranges
with for-in
loops, which might already be the case.
Finally, I suggest supporting Cartesian products of
ranges.
Finally, I suggest that
for x from 0 to X - 1 do
for y from 0 to Y - 1 do
could be written as
for (x, y) in (0 .. X - 1, 0 .. Y - 1)
or something like that. Maybe
for x, y in 0 .. X - 1 x 0 .. Y - 1
where x is the Cartesian product? Nah. Make them
tuples? I.e., use
[] again?
for x, y in [0 .. X - 1][0 .. Y - 1]
I like this, since it basically means that arrays are
nothing both
variables indexed over ranges that can now be multidimensional.
I would also like to be able to manipulate tuples. Say
x = event_x & y = event_y
->
(x, y) = (event_x, event_y)
likewise for updates and so forth.
Also, although I have not really thought in depth about this, but it
seems to me that there cannot be a formula, a module, and a variable
bearing the same name. Therefore, for consistency, and for a lighter
syntax, it might make more sense to use [] for the range, and () for
the accesses? Say
s[x][y] '= ...
would be
s(x, y) '= ...