Name

duro::operator - create and destroy user-defined operators

Synopsis

duro::operator arg ?arg ...?

Description

duro::operator create opname -returns returnType argList body txId

Creates a read-only operator opname with the return type returnType.

The argument argList defines the arguments of the operator. argList is a list of element pairs. The first element of each pair is a argument name and the second element is the type of the argument. Types are specified as in duro::table create.

The argument body contains the Tcl code which implements the operator. The arguments are available as Tcl variables. Values are represented the same way as values returned by duro::expr, with the following exception: If the operator is a getter, the actual representation of the argument is used instead of a possible representation.

duro::operator create opname -updates updList argList body txId

Creates an update operator opname. updList is a list of the arguments which are updated by the operator. These arguments must be passed to duro::call as Tcl variables.

The argument argList defines the arguments of the operator. argList is a list of element pairs. The first element of each pair is a argument name and the second element is the type of the argument.

The argument body contains the Tcl code which implements the operator. The arguments are available as Tcl variables. Values are represented the same way as values returned by duro::expr, with the following exceptions:

  1. Updated relation arguments are passed as table names.
  2. If the operator is a setter, the actual representation of the argument is used instead of a possible representation.

The transaction id passed to duro::call is available as $tx.

duro::operator drop opname txId

Deletes the operator opname.

$Id$