I am a bit confused by the new syntax wherein julia 0.6. I have something like this:
a=Dict(["a"=>"b"])
b=Dict(["a"=>3])
c=Dict(["a"=>"c"])
I need a function that gets a dictionary vector without the need for an explicit conversion. I tried:
function bbb(a::Vector{Dict{String, Any}})
println(a)
end
And it didn’t work.
Then i tried with
function bbb(a::Vector{Dict{String, T} where T})
println(a)
end
bbb([a,b]) #Works
bbb([a,c]) #Fails
bbb([a,b,c]) #Works
I overloaded bbb with every combination I can get to make an explicit conversion. But I'm still wondering how to do it right.
source
share