Destroying datum

Remove datum from the interpreter with the datdestroy command.

Whether datcreate or grmcreate is used to create a datum, that datum remains in the interpreter until it is destroyed. As long as it is in the interpreter, it uses a certain amount of memory.

The datdestroy command frees the resources of one or more datum objects. This command has two forms: one takes one or more datum handles as individual arguments; the other takes a single list of handles.

To destroy all of the datum objects in an interpreter:

datdestroy -list [datlist]

For example, these commands are equivalent:

datdestroy datum0 datum1 datum2

datdestroy -list "datum0 datum1 datum2"

The hcidatlistreset procedure, supplied in the system library, permits all but a particular set of datum handles to be destroyed. This command's only argument is the list of datum handles to preserve.

For example:

set datSaveList [datlist];# record existing handles
# Any amount of code which creates datum objects
# to be destroyed at the end of the section.
set newDatId [datcreate]
hcidatlistreset $datSaveList