diff --git a/README.md b/README.md index b9cc8cd3..301423ba 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,6 @@ Picrin is a lightweight scheme implementation intended to comply with full R7RS - `(reset h)` - `(shift k)` - - `(prompt h)` - - `(control k)` delimited control operators diff --git a/contrib/partcont/piclib/partcont.scm b/contrib/partcont/piclib/partcont.scm index 0ced262d..4c4e3b83 100644 --- a/contrib/partcont/piclib/partcont.scm +++ b/contrib/partcont/piclib/partcont.scm @@ -5,26 +5,28 @@ (define m #f) + (define (abort t) + (let ((v (t))) ; (t) may update m. do not place me like (m (t)) + (m v))) + (define (reset t) - (call/cc - (lambda (k) - (let ((n m)) + (let ((n m)) + (call/cc + (lambda (k) (set! m (lambda (r) (set! m n) (k r))) - (t))))) + (abort t))))) (define (shift h) (call/cc (lambda (k) - (h (lambda (v) - (reset (lambda () - (k v)))))))) - - (define prompt reset) - (define control shift) + (abort + (lambda () + (h (lambda (v) + (reset (lambda () + (k v)))))))))) (export shift - reset - control - prompt)) + reset)) +