Wishing a happy day,
Andreas
julia> d = Any[]
0-element Array{Any,1}
julia> type d1
name::AbstractString
content::Any[]
end
ERROR: TypeError: d1: in type definition, expected Type{T}, got Array{Any,1}
>> hello(v::Vector{Any}) = println("Hello")
>> hello([2,'a'])
Hello
>> hello([2,2])
ERROR: MethodError: no method matching hello(::Array{Int64,1})
in eval(::Module, ::Any) at /usr/local/Cellar/julia/HEAD/lib/julia/sys.dylib:-1It only works for vectors that are specifically of type Vector{Any}. Vector{Int64} is not a subtype of Vector{Any}.
This works, however, even though Vector is not a subtype of Vector{Any}:
>> goodbye(v::Vector) = println("bye, bye")
goodbye (generic function with 1 method)
>> goodbye([2,'a'])
bye, bye
>>> goodbye([2,2])
bye, bye
This works, however, even though Vector is not a subtype of Vector{Any}:
>> goodbye(v::Vector) = println("bye, bye")
goodbye (generic function with 1 method)
>> goodbye([2,'a'])
bye, bye
>>> goodbye([2,2])
bye, bye