|
| Previous: 2.11.1 Scoping Conflicts | TOC | Index | Back | Next: 2.13 Meta Commands |
In T3X, there are only very few type checking mechanisms to detect things like assignments to constants, calls of non-procedures, etc. Including the object meta type, T3X has six different types on which only specific operations are allowed. Type-related semantic checks carried through by the compiler intercept the following errors:
In a truly object oriented language with first class objects, however, more extensive type checking would be required. When, for example, an object is passed to or returned by a function, the reference to that object is stored in an ordinary variable. No type information is associated with such a variable. Therefore, the T3X compiler cannot determine the set of messages this object could answer. This problem has been solved by not allowing to send messages to any type of data object other than the object. The SEND operator may be used to circumvent this restriction. Like the CALL operator, SEND shall be used with special care.
The following table contains an overview over the operations which may be applied to each type of entity:
| Type | Evaluate | Alter | Call | Send to | Instantiate |
|---|---|---|---|---|---|
| Constant | + | - | - | - | - |
| Variable | + | + | (+) | (*) | - |
| Vector (#) | + | - | - | - | - |
| Procedure | + | - | + | - | - |
| Object | + | - | - | + | - |
| Class | + | - | - | - | + |
(+) Using the CALL operator
(*) Using the SEND operator
(#) A structure is a combination of a vector and a set of constants
In this context, evaluating an entity means to compute its value.
To alter an entity means to assign a new value to it.
Calling an entity denotes a procedure call and excludes sending
a message.
To send a message means to apply a method to an object.
To instantiate a class means to create a object.
| Previous: 2.11.1 Scoping Conflicts | TOC | Index | Back | Next: 2.13 Meta Commands |