November 2017
Beginner
316 pages
6h 40m
English
This function is used to return the subtype function of a type passed as its argument. Let's check the subtypes of the Number type:
julia> subtypes(Number)
2-element Array{Any,1}:
Complex{T<:Real}
Real
This is exactly what we were discussing in Julia's type hierarchy. An important relation to keep in mind is that now, for the types Complex and Real, the Number type will be seen as a supertype function. So, it depends upon the type hierarchy whether a specific data type becomes a subtype function and/or a supertype function.
Checking for subtypes of Any, we have a lot of them:
julia> subtypes(Any) 269-element Array{Any,1}: AbstractArray{T,N} AbstractChannel AbstractRNG AbstractSerializer AbstractString Any Associative ...Read now
Unlock full access