Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun too (state)
- (tagbody
- (if (null state)
- (progn
- (print 'set)
- (return-from too (lambda () (go next))))
- (progn
- (print 'call)
- (funcall state)))
- (go done)
- next
- (print 'hi)
- done))
- (defun foo ()
- (let ((state (too nil)))
- (funcall state))
- (values))
- (progn (compile 'too)
- (compile 'foo))
- (handler-case (foo)
- (error (err) (princ err) (terpri)))
- set Can't throw to tag (#<ccl::cant-throw-error #x302002691E5D> . 1152921504606846975)
- (defun foo ()
- (let ((state (too nil)))
- (dotimes (i 2)
- (tagbody
- (if (null state)
- (progn
- (print 'set)
- (setf state (lambda () (go next))))
- (progn
- (print 'call)
- (funcall state)))
- (go done)
- next
- (print 'hi)
- done)))
- (values))
- (compile 'foo)
- (foo)
- set
- call
- hi
- call
- hi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement