Skip to content

Request - unpack with default values #17

@Lincoln-Hannah

Description

@Lincoln-Hannah

Would it be possible to add a feature to allow unpacking with optional default values?

struct Foo
    a
    b
    c
end

p = Foo(10, 20,30)

@unpack { a=1, b,  x=1 }  =  p

a, b, x # gives (10, 20,  1)

@unpack { a=1, b, x }  =  p       #gives Error - x not present in p and no default value set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions