Calling with kwargs
milankl opened this issue · 1 comments
milankl commented
Say I have
using Parameters
@with_kw mutable struct Param
a::Int = 1
b::Int = 2
c::Bool = true
end
which is called in
function RunModel(;kwargs...)
P = Param(kwargs...)
# do something else
end
is there a way to empty all the variables from the kwargs
into the Param
struct? I currently get a no method matching error. Hopefully I can just convert the kwargs
somehow?
milankl commented
Nevermind, I just forgot the ;
function RunModel(;kwargs...)
P = Param(;kwargs...)
end