diff options
author | Ludovic Courtès <ludo@gnu.org> | 2010-07-15 18:39:49 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2010-07-15 23:12:57 +0200 |
commit | 88e41e94d3b80de5f96f7044ed35f0e1137377fc (patch) | |
tree | febbd85117cb7ed0decd70e7d1355091d718ad18 /module/sxml | |
parent | 736aff00863dc9e12a26e01aba63d29499c073ea (diff) | |
download | guile-88e41e94d3b80de5f96f7044ed35f0e1137377fc.tar.gz |
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.
Diffstat (limited to 'module/sxml')
-rw-r--r-- | module/sxml/match.scm | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/module/sxml/match.scm b/module/sxml/match.scm index d9d0285cf..9aebc019b 100644 --- a/module/sxml/match.scm +++ b/module/sxml/match.scm @@ -49,18 +49,20 @@ (syntax-rules () ((_) *unspecified*))) +(define %call/ec-prompt + (make-prompt-tag)) + (define-syntax call/ec ;; aka. `call-with-escape-continuation' (syntax-rules () ((_ proc) - (let ((prompt (make-prompt-tag))) - (call-with-prompt prompt - (lambda () - (proc (lambda args - (apply abort-to-prompt - prompt args)))) - (lambda (_ . args) - (apply values args))))))) + (call-with-prompt %call/ec-prompt + (lambda () + (proc (lambda args + (apply abort-to-prompt + %call/ec-prompt args)))) + (lambda (_ . args) + (apply values args)))))) (define-syntax let/ec (syntax-rules () |