From cf509a4922bb906c99038a3f7c735d7b9de3cc71 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Thu, 17 Jul 2014 11:32:52 +0900 Subject: [PATCH] [bugfix] move define-auxiliary-syntax to the beginning. This made mac-env and use-env of cond expression different --- piclib/built-in.scm | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/piclib/built-in.scm b/piclib/built-in.scm index 764b282c..8269cbf0 100644 --- a/piclib/built-in.scm +++ b/piclib/built-in.scm @@ -131,6 +131,20 @@ (scheme cxr) (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 (er-macro-transformer (lambda (expr r compare) @@ -384,21 +398,6 @@ (lambda (expr rename compare) (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* quasiquote unquote unquote-splicing and or