Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formal spec of destructuring assignments #73

Open
thosakwe opened this issue Apr 25, 2018 · 0 comments
Open

Formal spec of destructuring assignments #73

thosakwe opened this issue Apr 25, 2018 · 0 comments

Comments

@thosakwe
Copy link
Contributor

thosakwe commented Apr 25, 2018

Meta-issue to add these to the spec document.

// Destructure tuple
var (x, y) = myPoint

// Destructure struct
var { width, height, top, bottom } = myRect

These can actually work side-by-side with regular variable declarations:

var
  { text, type, line, column } = myToken,
  span = source_span::FileSpan(line, column, text)
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

No branches or pull requests

1 participant