next up previous

12.6.6 Progn$

The progn$ function performs a set of actions for each field of a multifield value. The field of the current iteration can be examined with <loopvariable>, if specified. The index of the current iteration can be examined with <loopvariable>index. The progn$ function can use variables from outer scopes, and the return and break functions can also be used within a progn$ as long as they are valid in the outer scope. The return value of this function is the return value of the last action performed for the last field in the multifield value.

Syntax

(progn$ <list-spec> <expression>*)
<list-spec> ::=   <multifield-expression> |
                (<list-variable> <multifield-expression>)

Example

CLIPS> (progn$ (?field (create$ abc def ghi))
          (printout t "--> " ?field " " ?field-index " <--" crlf))
--> abc 1 <--
--> def 2 <--
--> ghi 3 <--
CLIPS>


next up previous