for
Syntax:
(for variable number number function)
Argument List:
variable: The storage for the counter. This will increase by one at the end of the function every time it is run.
number: The number that will be the initial value
number: The last number that the variable will be run as.
function: The function that will be run with all the different values or variable.
Returns:
Whatever the last run function in this returns.
Category:
iteration
Description:
Runs function using variable for every value between and including the two numbers.
Example:
Code: Select all
(block (sum)
(setq sum 0)
(for varies 3 8 (setq sum (add varies sum)))
)
Comment:
Useful in many ways. From doing a function on only a certain section of a list to calculating math problems.