ecl-logo Documentation

DefineObjectType

DefineObjectType[type,definition]out

defines a type and its fields.

Details

  • If the type has multiple levels, all previous levels must have previously been defined or this function $Fails
  • Input
    Output
    Attributes
  • HoldRest
  • Messages
  • NoTypeDefErrorThere is no Type named `1` defined.
    TypeAlreadyDefinedErrorA class with this name (`1`) is already defined.

Examples

Basic Examples  (3)

Define new Types:

Define sub Types:

Define a named Type:

Attributes  (1)

HoldRest  (1)

Parameters are held, so that the explicit type registry can be passed by reference:

Messages  (2)

NoTypeDefError  (1)

Parent Types must exist:

TypeAlreadyDefinedError  (1)

Type Names must be unique: