so there are no difference between Array{DataType, 1} and 
Array{Type{Int64}, 1} just as the example showed?   what about 
`foo(x::Array{DataType,1})  = x` and `foo(x::Array{Type{Int64}, 1})`?  

在 2015年10月10日星期六 UTC+8上午1:17:25,Cedric St-Jean写道:
>
> Array{Int64, 1} is an array of Ints. Type{Int64} is the type of a type, so 
> Array{Type{Int64}} is an array of types.
>
> On Friday, October 9, 2015 at 1:11:25 PM UTC-4, Gnimuc Key wrote:
>>
>> i think `Array{Type{Int64},1}` is a vector whose element type 
>> is constrained to `Int64`, but i'm confused by the outputs of the code 
>> below:
>>
>>
>> julia> a = Array{Type{Int64}}(2)
>> 2-element Array{Type{Int64},1}:
>>  #undef
>>  #undef
>>
>> julia> a[:] = [Int64, Float32]
>> 2-element Array{DataType,1}:
>>  Int64  
>>  Float32
>>
>> julia> isa(a[2], eltype(a))
>> false
>>
>>
>> julia> a
>> 2-element Array{Type{Int64},1}:
>>  Int64  
>>  Float32
>>
>>
>> the last line is so wired. 
>>
>

Reply via email to