unduplicated-slot-namesGBBopen CoreLinkswith-changing-dimension-valuesGoTo Top

with-changing-dimension-values   (unit-instance [dimension-name*]) declaration* form* => result*[Macro]

Purpose
Inform GBBopen that the dimensional values of a unit instance will potentially be changed by the evaluation of forms.

Package   :gbbopen

Module   :gbbopen-core

Arguments and values

unit-instance     A unit instance
dimension-name     A symbol specifying a dimension of unit-instance
declaration     A declare expression (not evaluated)
forms     An implicit progn of forms to be evaluated
results     The values returned by evaluating the last form

Returns
The values returned by evaluating the last form.

Description
The indexing for unit-instance is updated following the evaluation of the last form. Any retrieval operations performed during the evaluation of forms may operate with indexes as they existed before evaluation of the first form; therefore, retrievals should not be included within the scope of with-changing-dimension-values. Retrievals performed by separate threads also should be synchronized with with-changing-dimension-values.

If dimension-names are specified, only the indexes for those dimensions of unit-instance will be updated. If no dimension-names are specified, the values of any or all dimensions of unit-instance are assumed to have been potentially changed by forms.

Examples
Notify GBBopen that the x, y, and belief dimension values of hyp might be changed:

  > (with-changing-dimension-values (hyp x y belief)
      (setf (location-of hyp) '(30 40))
      (setf (belief-of hyp) 0.78))
  0.78
  >
Notify GBBopen that some dimension values of hyp might be changed:
  > (with-changing-dimension-values (hyp)
      (setf (location-of hyp) '(36 52))
      (incf (belief-of hyp) 0.05))
  0.83
  >


The GBBopen Project


unduplicated-slot-namesGBBopen CoreLinkswith-changing-dimension-valuesGoTo Top