do-instances-on-space-instancesInstance Retrievalfilter-instancesdo-sorted-instances-of-classGoTo Top

do-sorted-instances-of-class   (var unit-classes-specifier predicate &key key) {tag | form}*[Macro]

Purpose
Iterate over each unit instance of the specified unit classes, in sorted order.

Package   :gbbopen

Module   :gbbopen-core

Arguments and values

var     A variable symbol
unit-classes-specifier     An extended unit-classes specification (see below)
predicate     A function designator specifying a function object of two arguments that returns a generalized boolean
key     A function designator specifying a function object of one argument, or nil (default is nil)
declaration     A declare expression (not evaluated)
tag     A go tag (not evaluated)
form     A form

Detailed syntax

unit-classes-specifier ::= t | single-unit-class-specifier | (single-unit-class-specifier+)

single-unit-class-specifier ::= atomic-unit-class | (atomic-unit-class subclassing-specifier)
atomic-unit-class ::= unit-class | unit-class-name
subclassing-specifier ::= :plus-subclasses | :no-subclasses | + | =

The shorthand + subclasses specifier is equivalent to :plus-subclasses and = to :no-subclasses.

Description
The iteration is performed once for each unit instance of the specified unit classes, whether or not the instances reside on any space instances.

See also
    do-instances-of-class
    find-instances-of-class
    make-instances-of-class-vector
    map-instances-of-class
    map-instances-on-space-instances
    map-sorted-instances-of-class

Example
Print a list of all hyp instance names, in ascending order:

  (do-sorted-instances-of-class (instance 'hyp #'< :key #'instance-name-of)
     (print (instance-name-of instance)))


The GBBopen Project


do-instances-on-space-instancesInstance Retrievalfilter-instancesdo-sorted-instances-of-classGoTo Top