Skip to content

Conversation

dgkf
Copy link
Owner

@dgkf dgkf commented Oct 2, 2023

  • Adds destructuring assignment (x, y) <- (a = 1, b = 2). I hope to expand this in the future for arbitrarily nested built-in data type matching, but for now it only works with named and unnamed symbols.

Minor changes

  • Updated pairs syntax (used for vectors and lists) to disallow more than one trailing comma
  • Disallow .s in symbols! After many years of R this still feels weird and is used for both names and meaningful S3 method notation.
  • Trying to index into a list with a name it does not contain no longer erroneously returns the first element.

@dgkf dgkf linked an issue Oct 2, 2023 that may be closed by this pull request
@dgkf dgkf merged commit 1f3b17c into main Oct 2, 2023
@dgkf dgkf deleted the 47-matched-assign branch October 2, 2023 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pattern matched assignment
1 participant