Skip to content

ban fully-numeric variable names as for bounds #369

Open

Description

@trillllian
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.

Activity

  1. p4plus2 commented on May 8, 2025

    @p4plus2
    Collaborator

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions