chickadee » sicp » ambeval*

ambeval* exp envprocedure
ambeval* exp env nprocedure

Gathers the results of up to n successful executions of exp; if n is missing, gathers all successful executions until failure.

exp
The expression to execute
env
The environment to execute it in
n
The number of results to gather
(define ambeval*
  (case-lambda
    ((exp env) (ambeval* exp env +inf.0))
    ((exp env n) (ambeval-map exp env values n))))