@head @module std @title Class std::Type @index Type
Instances of the Type class represent types (classes or interfaces). They are primarily used for constructing objects (class instances) and for testing the type of objects. The Type constructor cannot be used to build new classes. New types can only be defined using the class and interface constructs. @class Type @desc The Type type. You cannot call this object to create new type objects. @end @see @href{Function types} in Introduction to Alore Type System. @end @see @ref{reflect::TypeOf} allows querying the class of arbitrary objects. @end
Type objects support the following operations: @op type(...) @desc Construct an instance of the type by calling the type object. This operation is only valid for type objects that represent classes. The arguments are passed to the create method of the class. @note Some primitive types do not support directly calling the type object. Instances of these classes must be constructed using other means, such as by using the to operator for creating @ref{Range} objects. @end @end @op x is type @optype{Object is Type} @desc Return a boolean indicating whether x is an instance of type or a subtype of type. If x is nil, return False. @end @op Str(type) @desc Return a string containing the fully qualified name of the type. @end