In this hierarchy, some types, such as Number
, Integer
, and Signed
, are abstract, which means that they have no concrete objects or values of their own. Instead, objects or values are of concrete types given by the result of applying typeof(value)
, such as Int8
, Float64
, and String
. For example, the concrete type of the value 5
is Int64
given by typeof(5)
(on a 64-bit machine). However, a value also has the type of all of its supertypes; for example, isa(5, Number)
returns true (we introduced the isa
function in the Types section of Chapter 2, Variables, Types, and Operations).
Concrete types have no subtypes and might only have abstract types as their supertypes. Schematically, we can differentiate them as follows:
Type | Instantiate | Subtypes |
|
|
|
|
|
|
An abstract type (such as Number
and Real
) is only a name that groups multiple subtypes together, but it can be used as a type annotation or used as a type in array literals. These types are the nodes in the...