Skip to content

unpack into renamed local variables #18

@tpapp

Description

@tpapp

Sometimes one wants to unpack values of two similar (or the same) types in a local scope and then variable names clash. A typical example is implementing an operator or some types, eg

function Base.==(x::MyAB, y::MyAB)
    x.a == y.a && x.b == y.b
end

Cf common-lisp:with-slots. I wonder if there is some syntax we could co-opt for this purpose.

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