在julia中收集dict中的函数关键字参数
如何在Julia中获取dict中函数的关键字参数及其默认值 例如:在julia中收集dict中的函数关键字参数,julia,keyword-argument,Julia,Keyword Argument,如何在Julia中获取dict中函数的关键字参数及其默认值 例如: 只需创建一个Dict,如下所示: function foo(x; a = 1, b = 2, c= 3) Dict(:a => a, :b => b, :c => c) end 只需创建一个Dict,如下所示: function foo(x; a = 1, b = 2, c= 3) Dict(:a => a, :b => b, :c => c) end 您可以使用splat…运算符
只需创建一个Dict,如下所示:
function foo(x; a = 1, b = 2, c= 3)
Dict(:a => a, :b => b, :c => c)
end
只需创建一个Dict,如下所示:
function foo(x; a = 1, b = 2, c= 3)
Dict(:a => a, :b => b, :c => c)
end
您可以使用splat
…
运算符:
function foo(x; kwargs...)
Dict(kwargs)
end
或者,如果您只是想通过考试:
function foo(x; kwargs...)
innerfunction(x; kwargs...)
end
您可以使用splat
…
运算符:
function foo(x; kwargs...)
Dict(kwargs)
end
或者,如果您只是想通过考试:
function foo(x; kwargs...)
innerfunction(x; kwargs...)
end
args=Dict(:a=>a,:b=>b,:c=>c)
?cfargs=Dict(:a=>a,:b=>b,:c=>c)
?cf