asar
asar copied to clipboard
ban fully-numeric variable names as `for` bounds
trafficstars
for !i = 1..2
endfor
is legal if the define !i already exists and contains a number, as this will expand to for 0 = 1..2, and !0 is a legal define name. (and since !i exists, using it inside the loop will use the old value for each iteration, instead of throwing an error.)
this can be quite a nasty footgun, so i think we should ban fully-numeric for loop variables, even if that's less consistent.
I would vote for printing a warning instead. Possibly in all cases, but that can be debated. I think a warning keeps consistency but gives the user enough feedback to catch mistakes.