Named parameters with type overloads

Start a new topic instead next time. Link and quote the comments in an inactive thread you’re replying to. It is more polite to the previous participants and saves the admins the trouble of splitting the topic for you.

Most other languages don’t have multimethods, and that’s the exact reason why methods are dispatched on positional arguments. Trying to mix it up makes multimethods an unfeasible nightmare to write, so it’s only a feasible feature for single-method functions.

You’d change this behavior:

julia> foo(a, b) = 1
foo (generic function with 1 method)

julia> foo(;a, b) = 2
foo (generic function with 2 methods)

julia> foo(b = 1, a = 1;)
2
1 Like