The perform macro is used to create tasks. A task is the application of a specific Loom action (implemented as a set of methods) to one or more objects. The perform macro executes the task immediately, rather than queuing it for later execution (as schedule does).
perform (actionName &rest arguments) &key returnOption
The actionName argument is the name of the action which is to be applied to arguments. The procedure actually performed depends on which of the methods attached to actionName have their situation patterns satisfied by arguments.
The arguments argument contains zero or more variables or constants. Keyword arguments are supported, but optional and rest arguments are not.
The returnOption argument specifies what kind of value the action should return. The options are:
If returnOption is not supplied, it defaults to :value.
- The :value option indicates that perform should return the value of the last method that was applied, or nil if there were no applicable methods.
- The :success-p option indicates that perform should return t if (1) one or more methods were applied and none of them called fail, or (2) there were no applicable methods and the :no-op missing-method option was supplied in the definition of actionName. Otherwise, nil should be returned.
- The :task option indicates that a task should be created and immediately performed, and that perform should return the completed task object.
The return value of perform is determined by the returnOption argument (see above).
Tasks may be performed as a result of production firings, as well as explicit calls to perform.
(perform (weigh-box box)) ==> 44
(perform (inspect-box box shipper) :return :success-p) ==> T
(perform (notify-shipper (fi Acme)) :return :task) ==>
Last modified: Jun 1 1995