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 Assignment #64

Open
4 tasks
ballercat opened this issue Jan 7, 2018 · 1 comment
Open
4 tasks

Destructuring Assignment #64

ballercat opened this issue Jan 7, 2018 · 1 comment

Comments

@ballercat
Copy link
Owner

Goal

Allow users to use destructuring assignment.

Overview

Destructuring assignment is pretty helpful and should be implemented. Destructured variables should become locals. Destructured variables should not need type annotation as they can be inferred, so that is super useful.

Acceptance Criteria

  • const [x, y] = arrayObject;
  • const {x, y} = vectorObject;
  • Type annotations for destructured locals are not necessary
  • Tests
@JobLeonard
Copy link

WASM "is" a stack machine, right? Does that mean you can in theory return multiple values by leaving multiple values on the stack, like in Forth and other concatenative languages? Is something like (type (func (param i32) (result i32 i32))) legal WASM?

Asking out of curiosity of how returning multiple values might be implemented in Walt (not directly applicable to destructuring, but potentially a way of doing "strength reduction" if an optimising pass is ever introduced?)

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

No branches or pull requests

2 participants