Differences

This shows you the differences between two versions of the page.

cps-refresher [2013/02/12 14:01]
jhemann
cps-refresher [2013/02/12 14:09] (current)
jhemann
Line 33: Line 33:
<code lisp> <code lisp>
-(define empty-k +(define empty-k
  (lambda ()   (lambda ()
-    (let ([okay #t])+    (let ((once-only #f))
      (lambda (v)       (lambda (v)
-        (if okay +        (if once-only  
-            (begin +         (error 'empty-k "You can only invoke the empty continuation once"
-              (set! okay #f) +          (begin (set! once-only #t) v))))))
-              v) +
-           (errorf 'empty-k "k invoked in non-tail position"))))))+
</code> </code>
 

cps-refresher.txt · Last modified: 2013/02/12 14:09 by jhemann