dolist
[:loop-variable list] [commands to run]
Parameters:
[:loop-variable list] |
List of commands |
On each iteration, :loop-variable is assigned to each element of the list |
[commands to run] |
List of commands |
Commands to run once for each element of the list |
Description:
This command loops over each element of the list, and runs [commands to run] for each one. During each run of [commands to run], the element of the list is bound to loop-variable
.
Examples:
dolist [:i [2 4 -1]] [fd :i]
loops over the list [1 2 3]
. There are three iterations of this loop; in the first, we run fd 2
, in the second fd 4
and the third fd -1
.
Related Commands:
dotimes