1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 22:10:21 +02:00

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.
This commit is contained in:
Andy Wingo 2011-11-04 13:44:41 +01:00
parent ef9ffe5efd
commit f698b7286f
2 changed files with 2 additions and 17 deletions

View file

@ -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)

View file

@ -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