![]() | ![]() | ![]() | find-instance-by-name | ![]() |
|
| instance-name
&optional unit-class-specifier errorp | [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)
| |
| errorp | A generalized boolean (default is nil)
| |
| unit-instance | A unit instance or nil
|
Returns
The first unit instance found of the specified
nil otherwise.
Errors
If errorp is true, an error is signaled if no unit instance is found.
Detailed syntax
|
| atomic-unit-class |
(atomic-unit-class subclassing-specifier) |
t |
|
| unit-class | unit-class-name |
|
| :plus-subclasses | :no-subclasses |
+ | = |
The shorthand + subclasses specifier is equivalent to
:plus-subclasses and = to :no-subclasses.
Description
The :instance-name-comparison-testeq, eql, equalequalpequalequalp
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]> > (find-instance-by-name 0 'hyp) nil > (find-instance-by-name 0 'hyp 't) No unit instance named 0 of class hyp was found. >
REPL Note
Find-instance-by-name can be invoked using the REPL command:
:fi instance-name [unit-classes-specifier [errorp]]which sets
= to the found unit instance.
The GBBopen Project
![]() | ![]() | ![]() | find-instance-by-name | ![]() |