change let/cc
and let/ec
macros back to call/cc
and call/ec
When `call/cc` and `call/ec` were moved out of `#%kernel`, the `let/cc` and `let/ec` macros changed to refer to `call-with-current-continuation` and `call-with-escape-continuation`. Move `call/cc` and `call/ec` again and restore the macros, so that matching on the expansion of the macros (e.g,. in the web server's language that looks for `call/cc`) work as before.
This commit is contained in:
parent
0c31a0c0b8
commit
49c4d9272f
|
@ -71,6 +71,8 @@
|
|||
"bad syntax"
|
||||
x)))))
|
||||
|
||||
(define-values (call/ec) call-with-escape-continuation)
|
||||
|
||||
(-define-syntax let/ec
|
||||
(lambda (code)
|
||||
(let ([l (syntax->list code)])
|
||||
|
@ -81,7 +83,7 @@
|
|||
[exprs (stx-cdr (stx-cdr code))])
|
||||
(datum->syntax
|
||||
(quote-syntax here)
|
||||
`(call-with-escape-continuation (lambda (,var) ,@(stx->list exprs)))
|
||||
`(call/ec (lambda (,var) ,@(stx->list exprs)))
|
||||
code))
|
||||
(raise-syntax-error
|
||||
#f
|
||||
|
@ -198,4 +200,4 @@
|
|||
(syntax-local-introduce super-id))
|
||||
result))))))))))
|
||||
|
||||
(#%provide -define -define-syntax when unless let/ec -define-struct))
|
||||
(#%provide -define -define-syntax when unless call/ec let/ec -define-struct))
|
||||
|
|
|
@ -300,13 +300,12 @@
|
|||
(set! id temp) ...)))])))
|
||||
|
||||
(define-values (call/cc) call-with-current-continuation)
|
||||
(define-values (call/ec) call-with-escape-continuation)
|
||||
|
||||
(define-syntax let/cc
|
||||
(lambda (stx)
|
||||
(syntax-case stx ()
|
||||
[(_ var body1 body ...)
|
||||
(syntax/loc stx (call-with-current-continuation (lambda (var) body1 body ...)))])))
|
||||
(syntax/loc stx (call/cc (lambda (var) body1 body ...)))])))
|
||||
|
||||
(define-syntax fluid-let
|
||||
(lambda (stx)
|
||||
|
@ -389,6 +388,6 @@
|
|||
(rename break-paramz? break-parameterization?)
|
||||
with-handlers with-handlers* call-with-exception-handler
|
||||
set!-values
|
||||
let/cc call/cc call/ec fluid-let time
|
||||
let/cc call/cc fluid-let time
|
||||
log-fatal log-error log-warning log-info log-debug define-logger
|
||||
hash-ref! hash-has-key? hash-update hash-update!))
|
||||
|
|
Loading…
Reference in New Issue
Block a user