rtulip / haystack

Haystack is a compiled, statically typed, stack-based language with opt-in variable assignment.
MIT License
25 stars 2 forks source link

Tuple destructuring #180

Closed rtulip closed 1 year ago

rtulip commented 1 year ago

Adds support to destructure a tuple:

Rather than having to write:

fn main() {
    [1 2] as [tuple]
    tuple::0 println
    tuple::1 println
}

You can now write:

fn main() {
    [1 2] as [[a b]]
    a println
    b println
}