std::Type class

Instances of the Type class represent types (classes). 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 construct.

class Type
The Type type. This object cannot used to build new classes.

See also: reflection::TypeOf allows querying the type of arbitrary objects.

Methods

members()
Return an array of all defined public member names for the type. The order of the names is arbitrary. The array includes both members defined directly in the type and any inherited members. Not implemented yet
supertype()
Return the supertype of the type, or nil if the type has no supertype.

Operations

Type objects support the following operations:

type(...)
Construct an instance of the type by calling the type object. The arguments are passed to the create method of the type.

Note: Some primitive types do not support directly calling the type object. Instances of these types must be constructed using other means, such as by using the to operator for creating Range objects.

x is type
Return a boolean indicating whether x is an instance of type or a subtype of type. If x is nil, return False.
Str(type)
Return a string containing the fully qualified name of the type.