(define get-first
(lambda (l)
(call-with-current-continuation
(lambda (here)
(set! leave here)
(waddle l)
(leave (quote ()))))))
(define get-first
(lambda (l)
(call-with-current-continuation
(lambda (here)
(set! leave here)
(leave (waddle l))))))
For anyone who is not familiar with the book "of The Seasoned Schemer", get-first, get-nextand waddle(the last two are not defined herein), are procedures, apparently to simulate coroutines to iterate over the tree, passed in waddle, which gives leaves only. Just before it waddleissues its second-last reentry, it sets the reentry point to where it only ever returns a pure value '(), that is, instead of giving '(), the actual value waddle '(), as if it were a pure function.
, get-first... waddle " ", call/cc get-first, (leave (quote ())) - get-first (, , leave get-next , get-next "" '()).
, , waddle '() leave?