chickadee » anaphora » nwhile

(nwhile name test xpr . xprs)syntax

Named version of while.

The body xpr . xprs is evaluated as often, as the test is true. As usual, the result of this test, which often is the result of a poll operation, is named name and can be referenced in the body.

(let ((lst '(1 2 3 4 5 #f)) (res '()))
	(nwhile it (car lst)
		(set! res (cons (car lst) res))
		(set! lst (cdr lst)))
	res)

Of course, this is not the preferred programming style in Scheme ...