find-all-instances-by-nameInstance Retrievalfind-instancesfind-instance-by-nameGoTo Top

find-instance-by-name   instance-name &optional unit-class-specifier => unit-instance[Function]

Purpose
Retrieve a unit instance by its instance name.

Package   :gbbopen

Module   :gbbopen-core

Arguments and values

instance-name     The instance name for the retrieval
unit-class-specifier     An extended unit-class specification (see below; default is t)
unit-instance     A unit instance or nil

Returns
The first unit instance found of the specified class(es) that has the specified instance-name if one exists; nil otherwise.

Detailed syntax

unit-class-specifier ::= atomic-unit-class | (atomic-unit-class subclassing-specifier) | t

atomic-unit-class ::= unit-class | unit-class-name
subclassing-specifier ::= :plus-subclasses | :no-subclasses

Description
The :instance-name-comparison-test function (eq, eql, equal, or equalp) specified in define-unit-class is used to match instance-name with the unit-instance's instance name. If you are using strings as the names of unit instances, you should specify equal (case sensitive) or equalp (case insensitive) as the comparison function in the unit classes of those unit instances.

See also
    define-unit-class
    filter-instances
    find-instances
    find-all-instances-by-name

Example
Find the hyp unit instance 419:

  > (find-instance-by-name 419 'hyp)
  #<hyp 419 (1835 4791) 0.85 [5..35]>
  >

Note
Find-instance-by-name can be invoked using the REPL command:

  :fi [instance-name [class-name]]
which sets = to be the found unit instance.


The GBBopen Project


find-all-instances-by-nameInstance Retrievalfind-instancesfind-instance-by-nameGoTo Top