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

Allow destructuring from tuples? #32

Open
RoyalIcing opened this issue Jun 15, 2024 · 0 comments
Open

Allow destructuring from tuples? #32

RoyalIcing opened this issue Jun 15, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@RoyalIcing
Copy link
Owner

Now we can return tuples #20 we might want to use tuples for other operations such as assignment.

We could allow someone to write:

  defw example(), I32, a: I32, b: I32 do
    {a, b} = func_returning_two_i32s()
    a + b
  end

You can’t have a local in WebAssembly be backed by more than a primitive (you can’t have local a be {i32, i32}), so that prevents us from writing a = func_returning_two_i32s(). (Unless we added higher-level combo locals on top, which I want to wait and see with Orb 1.0 and how people find writing programs in it).

@RoyalIcing RoyalIcing added the enhancement New feature or request label Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant