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

Destructuring starts at 0 #18

Open
sigmasoldi3r opened this issue Oct 21, 2020 · 0 comments
Open

Destructuring starts at 0 #18

sigmasoldi3r opened this issue Oct 21, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@sigmasoldi3r
Copy link
Owner

As in javascript the natural first element of an array is 0, when destructuring, the compiler will assign that index to the first element. That's not the case for Lua, hence when destructuring you must always include a nil element:

(let [[_ a b c] some-list]
  ...)
@sigmasoldi3r sigmasoldi3r added the bug Something isn't working label Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant