copy-instance [Function]


Purpose

The copy-instance function creates a new (unclassified) Loom instance that contains assertions equivalent to those in an existing Loom instance.

Syntax

copy-instance instance &key identifier add-suffix-p context

Arguments

The instance argument is the instance to be copied.

The identifier argument is a symbol or string which identifies the newly-created copy. If this argument is nil, the copy is given a unique system-generated identifier.

If the add-suffix-p argument is t, identifier is suffixed with a unique integer. If identifier is nil, this is a no-op.

The context argument is the context in which the copy will be interned. This defaults to the current context.

Value

The copy-instance function returns the newly-created copy of instance.

Remarks

The copy does not actually assume the type of the original instance until the instance classifier is run (by tellm or new-time-point, for example).

If identifier is the same as the identifier of an existing instance, and add-suffix-p is nil, then Loom asks whether the user really wants to overwrite the existing instance, causing the older instance to be partially uninterned.

Examples

(copy-instance (fi Joe)) ==> |I|PERSON-34 
(copy-instance (fi Joe) :identifier "Moe" :context cxt) ==> |I|MOE 
(copy-instance (fi Moe) :identifier 'Moe :add-suffix-p t) ==> |I|MOE-35

See Also

Last modified: Jun 1 1995