get-instance [Function]


Purpose

The get-instance function returns the instance having a specified identifier.

Syntax

get-instance instance &key error-p context

Arguments

The instance argument is an instance, or a symbol which identifies an instance. If it is a symbol, it may be an extended identifier having the form context\^{\space}identifier, where context is the context from which the search is to proceed.

If the error-p argument is t, then an error is generated if Loom cannot find an instance having the specified identifier.

The context argument is the context, or the name of the context, from which the lookup is to be performed. The object will be found if it is interned in context or any context above context. This argument defaults to the current context.

Value

The get-instance function returns the instance with the specified identifier. If there is none, nil is returned unless error-p is set, in which case a continuable error is generated.

Remarks

The get- functions are faster and do less error-checking than the find- functions (such as find-instance). Applications should use the get- functions for best performance.

Examples

(get-instance 'Joe) ==> |I|JOE 
(get-instance 'cl-user-theory\^{\space}Mary :error-p t) ==> |I|MARY 
(get-instance 'New-York :context 'bottom-theory) ==> |I|NEW-YORK

See Also

Last modified: Jun 1 1995