From f698b7286f08fa23e7f71b072c5104a64c21947e Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Fri, 4 Nov 2011 13:44:41 +0100 Subject: [PATCH] minor psyntax refactors * module/ice-9/psyntax.scm (syntax-type): Remove redundant lexical case. (syntax-rules, define-syntax-rule): Use `_' instead of `dummy' for the keyword. * module/ice-9/boot-9.scm (define-syntax-rule): Remove redundant definition. --- module/ice-9/boot-9.scm | 14 -------------- module/ice-9/psyntax.scm | 5 ++--- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm index b2e12711a..11a6d061b 100644 --- a/module/ice-9/boot-9.scm +++ b/module/ice-9/boot-9.scm @@ -410,20 +410,6 @@ If there is no handler at all, Guile prints an error and then exits." ;; The binding for `macroexpand' has now been overridden, making psyntax the ;; expander now. -(define-syntax define-syntax-rule - (lambda (x) - (syntax-case x () - ((_ (name . pattern) template) - #'(define-syntax name - (syntax-rules () - ((_ . pattern) template)))) - ((_ (name . pattern) docstring template) - (string? (syntax->datum #'docstring)) - #'(define-syntax name - (syntax-rules () - docstring - ((_ . pattern) template))))))) - (define-syntax and (syntax-rules () ((_) #t) diff --git a/module/ice-9/psyntax.scm b/module/ice-9/psyntax.scm index 07bb0e4ed..4b02d6427 100644 --- a/module/ice-9/psyntax.scm +++ b/module/ice-9/psyntax.scm @@ -1115,7 +1115,6 @@ (b (lookup n r mod)) (type (binding-type b))) (case type - ((lexical) (values type (binding-value b) e w s mod)) ((global) (values type n e w s mod)) ((macro) (if for-car? @@ -2652,7 +2651,7 @@ #((macro-type . syntax-rules) (patterns pattern ...)) (syntax-case x (k ...) - ((dummy . pattern) #'template) + ((_ . pattern) #'template) ...))) ((_ (k ...) docstring ((keyword . pattern) template) ...) (string? (syntax->datum #'docstring)) @@ -2662,7 +2661,7 @@ #((macro-type . syntax-rules) (patterns pattern ...)) (syntax-case x (k ...) - ((dummy . pattern) #'template) + ((_ . pattern) #'template) ...)))))) (define-syntax define-syntax-rule