[bugfix] move define-auxiliary-syntax to the beginning. This made

mac-env and use-env of cond expression different
This commit is contained in:
Yuichi Nishiwaki 2014-07-17 11:32:52 +09:00
parent 73a6eaf9da
commit cf509a4922
1 changed files with 14 additions and 15 deletions

View File

@ -131,6 +131,20 @@
(scheme cxr) (scheme cxr)
(picrin macro)) (picrin macro))
(define-syntax define-auxiliary-syntax
(er-macro-transformer
(lambda (expr r c)
(list (r 'define-syntax) (cadr expr)
(list (r 'lambda) '_
(list (r 'error) "invalid use of auxiliary syntax"))))))
(define-auxiliary-syntax else)
(define-auxiliary-syntax =>)
(define-auxiliary-syntax _)
(define-auxiliary-syntax ...)
(define-auxiliary-syntax unquote)
(define-auxiliary-syntax unquote-splicing)
(define-syntax let (define-syntax let
(er-macro-transformer (er-macro-transformer
(lambda (expr r compare) (lambda (expr r compare)
@ -384,21 +398,6 @@
(lambda (expr rename compare) (lambda (expr rename compare)
(apply error (cdr expr))))) (apply error (cdr expr)))))
(define-syntax define-auxiliary-syntax
(er-macro-transformer
(lambda (expr r c)
`(,(r 'define-syntax) ,(cadr expr)
(,(r 'sc-macro-transformer)
(,(r 'lambda) (expr env)
(,(r 'error) "invalid use of auxiliary syntax")))))))
(define-auxiliary-syntax else)
(define-auxiliary-syntax =>)
(define-auxiliary-syntax _)
(define-auxiliary-syntax ...)
(define-auxiliary-syntax unquote)
(define-auxiliary-syntax unquote-splicing)
(export let let* letrec letrec* (export let let* letrec letrec*
quasiquote unquote unquote-splicing quasiquote unquote unquote-splicing
and or and or