All Manuals > LispWorks® User Guide and Reference Manual > 38 The LISPWORKS Package

with-action-list-mapping Macro

Summary

Maps over an action list's actions with given variables bound to the executing action and its data.

Package

lispworks

Signature

with-action-list-mapping (action-list item-var data-var &optional post-process) &body body

Arguments
action-list
An action list.
item-var
A Lisp symbol.
data-var
A Lisp symbol.
post-process
A keyword.
body
A body of Lisp code.
Description

The macro with-action-list-mapping evaluates body for every action-item of action-list. During evaluation of body, the symbols specified for item-var and data-var are bound to the executing action-item and its data respectively. See execute-actions for more on post-processing.

If post-process is :collect, then a list the values returned by each action-item's setf operation are returned.

Examples
(defun my-execution-function 
          (the-action-list other-args
           &key (post-process nil)
           &allow-other-keys)
    (declare (ignore other-args))
    (with-action-list-mapping (the-action-list
                               an-action-item
                               action-item-data
                               post-process)
      (do-something-interesting-first)
      (setf (symbol-value (car action-item-data))
            (apply (cadr action-item-data)
                   (cddr action-item-data)))))
See also

execute-actions


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:41