foreach


(foreach  entry  lst  [ exprA exprB ... ] )

This function iterates over all items the lst list, and processes all expressions using each item.

Arguments

entry  a Lisp variable to receive the next item of lst

lst  any list of items; each item is assigned to entry variable and the exprA exprB ... are processed with that entry

exprA  any Lisp expression

exprB  any Lisp expression

Return

the value of last evaluated expression

Example

(foreach item '(1 2 3 4 5)
  (print (sqrt item))
  (print (expt item 2))
  :
  :
)

Remarks

entry variable is local to the (foreach ...) scope !



©  Bricsys NV. All rights reserved.