About primitive types
Alore has a fixed set of primitive types: Int, Str, Float, Boolean, Constant, Function, Type, Pair and Range. Primitive types share these common properties:
- They are defined in the std module.
- Other types cannot inherit from primitive types.
- Their instances are immutable.
- Their instances support comparison for equality and hash value calculation with std::Hash.
- All primitive type constructors that accept arguments accept also objects of their own type to construct identical copies of them, so that Int(5) and Str("foo") are valid, for example.
Additionally, most primitive types have special syntax associated with creating instances of them.