hello(A::Matrix) = 1hello(A::Vector{Matrix}) = 2A = randn(3,3);AA = [randn(3,3) for k in 1:4];hello(A)hello(AA)
julia> hello(A)1
julia> hello(AA)ERROR: MethodError: `hello` has no method matching hello(::Array{Array{Float64,2},1})
hi(A::Array{Float64,2}) = 1hi(A::Array{Array{Float64,2},1}) = 2A = randn(3,3);AA = [randn(3,3) for k in 1:4];hi(A)hi(AA)
julia> hi(A)1
julia> hi(AA)2
julia> methods(hello)# 2 methods for generic function "hello":hello(A::Array{T,2}) at none:1hello(A::Array{Array{T,2},1}) at none:1
julia> AA = [randn(3,3) for k in 1:4];
julia> AAA = Matrix[randn(3,3) for k in 1:4];
julia> hello(AA)ERROR: MethodError: `hello` has no method matching hello(::Array{Array{Float64,2},1})
julia> hello(AAA)2
julia> typeof(AA)Array{Array{Float64,2},1}
julia> typeof(AAA)Array{Array{T,2},1}
julia> Array{T,2}ERROR: UndefVarError: T not defined
julia> foo{T}(A::Vector{Matrix{T}}) = 1
foo (generic function with 1 method)
julia> methods(foo)
# 1 method for generic function "foo":
foo{T}(A::Array{Array{T,2},1}) at none:1
julia> bar(A::Vector{Matrix}) = 1
bar (generic function with 1 method)
julia> methods(bar)
# 1 method for generic function "bar":
bar(A::Array{Array{T,2},1}) at none:1
julia> baz(A::Vector{Matrix{T}}) = 1
ERROR: UndefVarError: T not defined
julia> foo{T}(A::Vector{Matrix{T}}) = 1
julia> bar(A::Vector{Matrix}) = 1
baz(A::Vector{Matrix{T}}) = 1