| Did you know ... | Search Documentation: |
| Types |
Specifying a type
Both the declaration of send- and get methods requires type declarations. The type declarations for methods look very similar than those that can be found in this manual. A type either denotes a primitive type or a classname. In the latter case, any instance of a the referred class or a subclass thereof is a value satisfying the typecheck. While declaring a type using a classname, the class itself does not need to exist yet. This facilitate the definition of classes that are mutually dependent and thus want to use each other's name for typechecking.
The available primitive types are:
bool a boolean (@on or @off). int Integer value name Atomic name (`atom` is a synonym).
This basic type declaration can be augmented with some modifiers, indicating what should be done with the various special objects:
[Type] Argument may be @default (or, in other words,
argument is optional).
Type* Argument may be @nil.
Type? Special arguments (@receiver, @arg1, ... and
obtainers are not evaluated, but passed themselves
Both _*_ and _?_ are declared as postfix operators, which allows you to specify the type without using quotes.