![]() | ![]() | ![]() | map-instances-of-class | ![]() |
| function
| [Function] |
Purpose
Apply a function once to each unit instance of the
specified unit classes.
Package :gbbopen
Module :gbbopen-core
Arguments and values
function | A function designator specifying a function object of one argument | |
unit-classes-specifier | An extended unit-classes specification (see below) |
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 specified function is applied once to each
unit instance of the specified unit classes, whether
or not the instances reside on any space instances.
See also
class-instances-count
clear-space-instances
do-instances-of-class
find-instances-of-class
make-instances-of-class-vector
map-instances-on-space-instances
map-sorted-instances-of-class
Examples
Delete all unit instances of the unit class hyp
:
(map-instances-of-class #'delete-instance 'hyp)Delete all unit instances of the unit class
hyp
and
instances of subclasses of hyp
:
(map-instances-of-class #'delete-instance '(hyp :plus-subclasses))or simply:
(map-instances-of-class #'delete-instance '(hyp +))
Note
The consequences are unspecified if an attempt is made to add or delete a
unit instance while
(map-instances-of-class #'delete-space-instance '(standard-space-instance :plus-subclasses))because deletion of a space instance with children automatically deletes those child space instances. The function
REPL Note
The equivalent of (map-instances-of-class 'print arg)
:pic [unit-classes-specifier]If arg is omitted,
t
is used as the default.
The GBBopen Project
![]() | ![]() | ![]() | map-instances-of-class | ![]() |