Skip to content

Duplicate bindings not discovered at parse-time #154

Description

@pdarragh

In Racket, duplicate bindings in a let are a syntax error:

> (let ([x 1] [x 2]) x)
string:1:13: let: duplicate identifier
  at: x
  in: (let ((x 1) (x 2)) x)
 [,bt for context]

We don't perform these checks during parsing, though, and instead wait until interpretation or compilation to discover the issue. Historically this has been fine because we simply don't test syntactically invalid inputs.

However, as we continue to implement competitive elimination assignments with reference machines, it becomes important to improve the underlying implementations. I think it would be best if we incorporate checks for this in the parser going forward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions