Get the argument names of an function

The procedure in Get the argument names of an function - #3 by tim.holy still works; just stepping through to see how Julia does something is a useful skill for many questions. You’ll discover Base.kwarg_decl that way.

julia> m = @which sum(rand(3))
sum(a::AbstractArray; dims, kw...) in Base at reducedim.jl:994

julia> Base.kwarg_decl(m)
2-element Vector{Symbol}:
 :dims
 Symbol("kw...")
6 Likes