1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 12:20:26 +02:00

sxml-match: Always use the same prompt tag.

* module/sxml/match.scm (%call/ec-prompt): New variable.
  (call/ec): Use it instead of creating a new prompt tag.
This commit is contained in:
Ludovic Courtès 2010-07-15 18:39:49 +02:00
parent 736aff0086
commit 88e41e94d3

View file

@ -49,18 +49,20 @@
(syntax-rules () (syntax-rules ()
((_) *unspecified*))) ((_) *unspecified*)))
(define %call/ec-prompt
(make-prompt-tag))
(define-syntax call/ec (define-syntax call/ec
;; aka. `call-with-escape-continuation' ;; aka. `call-with-escape-continuation'
(syntax-rules () (syntax-rules ()
((_ proc) ((_ proc)
(let ((prompt (make-prompt-tag))) (call-with-prompt %call/ec-prompt
(call-with-prompt prompt
(lambda () (lambda ()
(proc (lambda args (proc (lambda args
(apply abort-to-prompt (apply abort-to-prompt
prompt args)))) %call/ec-prompt args))))
(lambda (_ . args) (lambda (_ . args)
(apply values args))))))) (apply values args))))))
(define-syntax let/ec (define-syntax let/ec
(syntax-rules () (syntax-rules ()