This module implements some miscellaneous useful procedures.
repeat REPEATVAR NUM-REPEATS . BODY | [Special Form] |
[undocumented]
yielding-thunk . BODY | [Special Form] |
Usage: (yielding-thunk BODY) Similar to lambda, yielding-thunk is a syntax that creates a procedure. The difference is that yielding-thunk provides a routine called `yield' that can perform a nonlocal exit from the function. The next time the procedure is called, execution resumes where yield was called. The procedure exits only when yield is called; if the end of the procedure is reached, the procedure is restarted. If any arguments are passed, the state of the procedure is reset. Example: (define f (yielding-thunk (yield 1) (yield 2) #f)) (f) => 1 (f) => 2 (f) => 1 To reset the thunk, pass 'reset as the first argument.
choose l | [Function] |
Chooses an element of l at random.
coin x | [Function] |
The probability of this function returning #t is $varx.
rrand x y | [Function] |
Returns a random number within [x,y).
shuffle! l | [Function] |
Shuffles the elements of l, possibly modifying the structure of its argument in the process.