There are a number of inconsistency problems currently though.
[1,2.3,4] gives Array{Float64,1},
but Dict(1=>1,2=>2.3,3=>3) gives Dict{Int64,Any}.
Another weird one with arrays that is inconsistent (hopefully will be fixed
in 0.5):
[1,2,[3,4]] gives a deprecation warning about concatenation, while
Any[1,2,[3,4]] give what I expected, i.e. Array{Any,1}
(Dict on the other hand gives me what I'd expect, i.e. Dict{Int64, Any}).
On Thursday, September 3, 2015 at 10:51:12 AM UTC-4, Steven G. Johnson
wrote:
>
>
>
> On Thursday, September 3, 2015 at 10:38:15 AM UTC-4, Jeff Bezanson wrote:
>>
>> There is no need to write the type over and over again. You can say
>>
>> const D = Dict{Symbol, Any}
>>
>> D(:a => "", :b => 0, ...)
>>
>
> There is also often no need to write the type at all:
>
> julia> Dict(:a => "", :b => 0)
>
> Dict{Symbol,Any} with 2 entries:
>
> :a => ""
>
> :b => 0
>
>
> The Dict constructor automatically computes the common parent of the key
> and value types.
>