map-instances-on-space-instancesInstance Retrievalreport-find-statsmap-sorted-instances-of-classGoTo Top

map-sorted-instances-of-class   function unit-classes-specifier predicate &key key[Function]

Purpose
Apply a function once to each unit instance of the specified unit classes, in sorted order.

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)
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)

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 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
    do-sorted-instances-of-class
    make-instances-of-class-vector
    map-instances-of-class

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

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


The GBBopen Project


map-instances-on-space-instancesInstance Retrievalreport-find-statsmap-sorted-instances-of-classGoTo Top