Within a function body I’d like to refer to a value of a named argument.
An example of what I have in mind, how to implement f
:
function f(; arg1, arg2, argname)
println("value of $argname is: ???")
end
so that it’s invocation produces:
julia> f(arg1 = 1, arg2 = "b", argname = "arg1")
value of arg1 is: 1
2 posts - 2 participants