Functions Documentation |
|
Name |
for |
Syntax |
(for var from to exp) -> value of last expression |
Argument List |
var: The storage for the counter. This will increase by one at the end of the function every time it is run.
from: The number that will be the initial value
to: The last number that the variable will be run as.
expr: The expression that will be evaluated with the current value set available under the name set in `variable' |
Returns |
Whatever the last expression returns. |
Category |
iteration
|
Description |
Evaluates expression using variable for every value between and including the two numbers. |
Example |
(block (sum)
(setq sum 0)
(for varies 3 8 (setq sum (add varies sum)))
)
This returns the number 33. |
Comment |
Useful in many ways. From doing a function on only a certain section of a list to calculating math problems. |