( (x,y) -> x+y ).( [ (1,2), (3,4) ] )

Actually argument destructuring is not based on pattern matching, it’s based on iteration. So rather than just working for tuples it works for any iterable which is passed:

julia> f((x,y)) = x+y
f (generic function with 1 method)

julia> f(Set([1,2]))
3

julia> f([1,2])
3

julia> f((1,2))
3

4 Likes