chickadee » foof-loop » LISTING!

(LISTING! [(INITIAL <tail>)] ...)syntax
(LISTING-INTO! <pair> [(INITIAL <tail>)] ...)syntax

Usage:

   (FOR <result> (LISTING! [(INITIAL <tail>)] ...))
   (FOR <result> (LISTING-INTO! <pair> [(INITIAL <tail>)] ...))

LISTING! builds up a list with a final cdr of <tail>. LISTING-INTO! builds up a list with a final cdr of <tail> and destructively stores it in the cdr of <pair>. Both use as little intermediate storage as possible, which may involve using destructive operations, and as a consequence are non-reentrant.

<Tail>, if supplied, is evaluated once in the environment outside the loop. The default value of <tail> is the empty list.

<Result> is a final variable.