Yes and yes (assuming you mean some concrete type like Int
or Int64
or Int32
). In fact, Int
s are “bits” types, which is an even stricter subset of immutability:
help?> isbitstype
search: isbitstype
isbitstype(T)
Return true if type T is a "plain data" type, meaning it is immutable and contains no references to other values,
only primitive types and other isbitstype types.
julia> isbitstype(Int)
true