do-instances-of-class |
| (var
| [Macro] |
Purpose
Iterate over all unit instances of the specified
unit classes.
Package :gbbopen
Module :gbbopen-core
Arguments and values
var | A variable symbol | |
unit-classes-specifier | An extended unit-classes specification (see below) | |
declaration | A declare expression (not evaluated) | |
tag | A go tag (not evaluated)
| |
form | A form |
Detailed syntax
| t |
single-unit-class-specifier
| ( single-unit-class-specifier+) |
| atomic-unit-class |
( atomic-unit-class subclassing-specifier) |
| unit-class | unit-class-name |
| :plus-subclasses | :no-subclasses |
+ | = |
The shorthand +
subclasses specifier is equivalent to
:plus-subclasses
and =
to :no-subclasses
.
Description
The iteration over the unit instances of the specified
unit classes is performed once for each unit instance, whether
or not the instances reside on any space instances.
See also
class-instances-count
clear-space-instances
do-instances-on-space-instances
find-instances-of-class
make-instances-of-class-vector
map-instances-of-class
map-instances-on-space-instances
map-sorted-instances-of-class
Examples
Delete all unit instances of the unit class hyp
:
(do-instances-of-class (instance 'hyp) (delete-instance instance))Delete all unit instances of the unit class
hyp
and
instances of subclasses of hyp
:
(do-instances-of-class (instance '(hyp :plus-subclasses)) (delete-instance instance))or simply:
(do-instances-of-class (instance '(hyp +)) (delete-instance instance))
Note
The consequences are unspecified if an attempt is made to add or delete a
unit instance while
(do-instances-of-class (space-instance '(standard-space-instance :plus-subclasses)) (delete-space-instance space-instance))because deletion of a space instance with children automatically deletes those child space instances. The function
REPL Note
The equivalent of (do-instances-of-class (instance arg)
(print instance))
:pic [arg]
t
is assumed.
The GBBopen Project
do-instances-of-class |