[<<][staapl][>>][..]
Tue Apr 15 21:10:42 EDT 2008

shift/reset breakpoint draft

(define tag (make-continuation-prompt-tag 'tag))

(define (make-split [more #t] )
  (lambda (inner)
    (shift-at tag
              rest
              (values (and more rest) inner))))

(define x add1)
(define y (make-split))
(define stop (make-split #f))

(define (make-composition . fns)
  (apply compose (reverse fns)))

(define (test fn input)
  (let next ((thunk (lambda () (reset-at tag (fn input)))))
    (let-values (((k v) (thunk)))
      (printf "v = ~s\n" v)
      (if k
          (next (lambda () (k v)))
          v))))


box> (test (make-composition x x y x x x y x x x x stop) 0)
v = 2
v = 5
v = 9
9


EDIT: i get it.. nested shifts will always return the deepset shift
free expression.



[Reply][About]
[<<][staapl][>>][..]