For example, we can fill a nested choicemap from an array:
julia> Gen._from_array(Gen.choicemap(:face => Gen.choicemap(:cake => 2), :foo => 3), [4, 5], 1)
(2, DynamicChoiceMap(Dict{Any, Any}(:face => DynamicChoiceMap(Dict{Any, Any}(:cake => 4), Dict{Any, Any}()), :foo => 5), Dict{Any, Any}()))
but the implementation of _from_array for vectors doesn't recursively call _from_array on its elements:
julia> Gen._from_array([1,2,[3]], [4,5,6], 1)
ERROR: MethodError: no method matching _from_array(::Vector{Any}, ::Vector{Int64}, ::Int64)
For example, we can fill a nested choicemap from an array:
but the implementation of
_from_arrayfor vectors doesn't recursively call_from_arrayon its elements: