chickadee » srfi-117 » list-queue-unfold

list-queue-unfold stop? mapper successor seed #!optional queueprocedure

Performs the following algorithm:

If the result of applying the predicate stop? to seed is true, return queue. Otherwise, apply the procedure mapper to seed, returning a value which is added to the front of queue. Then get a new seed by applying the procedure successor to seed, and repeat this algorithm.

If queue is omitted, a newly allocated list queue is used.