TadsObject class | systype.h[242]

The "TADS Object" intrinsic class. All objects that the program defines with the "class" or "object" statements descend from this class.

`intrinsic class TadsObject : Object`

Superclass Tree (in declaration order)

`TadsObject`
`Object`

Subclass Tree

(none)

Global Objects

(none)

Summary of Properties

``

``

(none)

Summary of Methods

`createClone createInstance createTransientInstance getMethod setMethod setSuperclassList`

Inherited from `Object` :
`getPropList getPropParams getSuperclassList isClass isTransient ofKind propDefined propInherited propType valToSymbol`

Properties

(none)

Methods

`createClone ( )` | `systype.h[260]`

Create a clone of this object. This creates an exact copy, with the same property values, as the original. This does not call any constructors; it merely instantiates an exact copy of the original.

Note that the clone is a "shallow" copy, which means that any objects it references are not themselves cloned.

`createInstance (...)` | `systype.h[250]`

Create an instance of this object: in other words, create a new object whose superclass is this object. The arguments provided are passed to the new object's constructor. This method returns a reference to the new object.

`createTransientInstance (...)` | `systype.h[267]`

Create a transient instance of this object. This works just like createInstance(), but creates a transient instance instead of an ordinary (persistent) instance.

`getMethod (prop)` | `systype.h[330]`

Get a method value. If the property is a method, this returns a function pointer to the method; this does NOT evaluate the method. If the property is not a method, this returns nil.

The returned function pointer can be called like an ordinary function, but such a call will have no 'self' value, so the disembodied method won't be able to refer to properties or methods of 'self'. The main use of this method is to get a method of one object to assign as a method of another object using setMethod().

`setMethod (prop, func)` | `systype.h[341]`

Set a method value. Assigns the given function (which must be a function pointer value) to the given property of 'self'. This effectively adds a new method to the object.

The function can be an ordinary named function, or a method pointer retrieved from this object or from another object with getMethod(). Anonymous functions are NOT allowed here.

`setSuperclassList (scList)` | `systype.h[317]`

Set the superclass list. scList is a list giving the new superclasses. The superclasses must all be TadsObject objects, with one exception: the list [TadsObject] may be passed to create an object based directly on TadsObject. No other intrinsic classes can be used in the list, and objects of other types cannot be used in the list.

TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3