Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #253 from picrin-scheme/syntax-rules-with-escape
Browse files Browse the repository at this point in the history
use escape instead of call/cc in syntax-rules.scm
  • Loading branch information
nyuichi committed Jan 26, 2015
2 parents 4c3a9fe + e49f983 commit 6afc94c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions piclib/picrin/syntax-rules.scm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(define-library (picrin syntax-rules)
(import (picrin base)
(picrin control)
(picrin macro))

(define-syntax define-auxiliary-syntax
Expand Down Expand Up @@ -74,7 +75,7 @@
(define _unquote (r 'unquote))
(define _unquote-splicing (r 'unquote-splicing))
(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 (var->sym v)
Expand Down Expand Up @@ -303,7 +304,7 @@
(match (list-ref (car clauses) 1))
(expand (list-ref (car clauses) 2)))
`(,_let ,(map (lambda (v) (list (var->sym v) '())) vars)
(,_let ((result (,_call/cc (,_lambda (exit) ,match))))
(,_let ((result (,_escape (,_lambda (exit) ,match))))
(,_if result
,expand
,(expand-clauses (cdr clauses) rename))))))))
Expand Down

0 comments on commit 6afc94c

Please sign in to comment.