find-instance [Function]


Purpose

The find-instance function, a robust variant of get-instance, searches for the istance having a specified identifier.

Syntax

find-instance instance &key no-warning-p ignore-package-p context

Arguments

The instance argument is an instance, or a symbol or string 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 no-warning-p argument is t, then no warning is generated if Loom cannot find an instance having the specified identifier.

If the ignore-package-p argument is t, then Loom searches across packages for the specified name.

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

Value

The find-instance function returns the instance with the specified identifier, or nil if none is found.

Remarks

The find- functions tend to be more flexible, slower, and do more error-checking than the get- functions (such as get-instance). Package-independent searches may be especially slow.

Examples

(find-instance 'Joe) ==> |I|JOE 
(find-instance 'cl-user-theory\^{\space}Mary :no-warning-p t) ==> |I|MARY 
(find-instance 'New-York :ignore-package-p t) ==> |I|NEW-YORK 
(find-instance "Joe" :context 'bottom-theory) ==> |I|JOE

See Also

Last modified: Jun 1 1995