This is a very bad implementation that I did a while ago:
|
# Convert (x=1,) to Dict(@varname(x) => 1) |
|
function to_varname_dict(nt::NamedTuple) |
|
return Dict{VarName,Any}(VarName{k}() => v for (k, v) in pairs(nt)) |
|
end |
It should really make sure that at least the value type, and possibly the key type, is as concrete as possible.
This is a very bad implementation that I did a while ago:
DynamicPPL.jl/src/utils.jl
Lines 851 to 854 in 08fffa2
It should really make sure that at least the value type, and possibly the key type, is as concrete as possible.