Orb icon indicating copy to clipboard operation
Orb copied to clipboard

Allow destructuring from tuples?

Open RoyalIcing opened this issue 1 year ago • 0 comments

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 avatar Jun 15 '24 05:06 RoyalIcing