Merge branch 'master' into c89-porting

This commit is contained in:
Sunrin SHIMURA (keen) 2015-02-01 12:30:35 +00:00
commit cc9de3295d
2 changed files with 4 additions and 2 deletions

View File

@ -9,3 +9,4 @@ Delimited control operators.
Escape Continuation Escape Continuation
- **(escape f)** - **(escape f)**

View File

@ -1,5 +1,6 @@
(define-library (picrin syntax-rules) (define-library (picrin syntax-rules)
(import (picrin base) (import (picrin base)
(picrin control)
(picrin macro)) (picrin macro))
(define-syntax define-auxiliary-syntax (define-syntax define-auxiliary-syntax
@ -74,7 +75,7 @@
(define _unquote (r 'unquote)) (define _unquote (r 'unquote))
(define _unquote-splicing (r 'unquote-splicing)) (define _unquote-splicing (r 'unquote-splicing))
(define _syntax-error (r 'syntax-error)) (define _syntax-error (r 'syntax-error))
(define _call/cc (r 'call/cc)) (define _escape (r 'escape))
(define _er-macro-transformer (r 'er-macro-transformer)) (define _er-macro-transformer (r 'er-macro-transformer))
(define (var->sym v) (define (var->sym v)
@ -303,7 +304,7 @@
(match (list-ref (car clauses) 1)) (match (list-ref (car clauses) 1))
(expand (list-ref (car clauses) 2))) (expand (list-ref (car clauses) 2)))
`(,_let ,(map (lambda (v) (list (var->sym v) '())) vars) `(,_let ,(map (lambda (v) (list (var->sym v) '())) vars)
(,_let ((result (,_call/cc (,_lambda (exit) ,match)))) (,_let ((result (,_escape (,_lambda (exit) ,match))))
(,_if result (,_if result
,expand ,expand
,(expand-clauses (cdr clauses) rename)))))))) ,(expand-clauses (cdr clauses) rename))))))))