Specializing on keyword arguments

I would use something like this, probably:

julia> function f(a; b=nothing, c=nothing)
           if isnothing(b) && isnothing(c)
               return _f(a)
           else
               return _f(a,b,c)
           end
       end
           
f (generic function with 1 method)

where _f(...) is the internal function for which the one with keyword arguments is the exposed interface.

3 Likes