Primitive and Composite? Types

thanks, aaron and twan.

[1] I am trying to organize my logic now in order to explain assignments and argument passing to functions to students and myself. I think I will need to explain something like a “container-type,” where assignments create aliases and not copies. Container types encompass arrays, structs, dicts, etc. does this make sense, or do I misunderstand something? Is there already a sanctioned name?

does julia has a built-in function to learn whether a type is a container type or not? presumably, I could write a function that could work by assigning a value to an instantiated alias, and seeing whether it affects the original. ugly but functional. or does this already exist?

[2] back to Unions. I think Union{Float64,Missing} is also pretty common (not just union with nothing). I failed to figure out how to create a non-vector union type scalar instance for experimenting (otherwise, pretty useless):

julia> xv= 2.0::Union{Float64, Missing}
2.0

julia> typeof(xv)
Float64

Thus I do not know how to experiment with whether this is internally a container or a non-container type.

It is not a primitive type or an abstract type:

julia> isprimitivetype( Union{Float64, Missing} )
false

julia> isabstracttype( Union{Float64,Missing} )
false

Moreover, the docs says "A type union is a special abstract type which includes as objects all instances of any of its argument types, " and gives as an example a Union of a Float64 with Abstractstring, but this does not trigger the isabstracttype() function:

julia> isabstracttype( Union{Float64,Missing} )
false

julia> isabstracttype( Union{Float64,AbstractString} )
false

so, abstracttypes and unions are a bit confusing to me, too. is a union float-missing a primitive type or an abstract type or a … ?

/iaw