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:
parent
ef9ffe5efd
commit
f698b7286f
2 changed files with 2 additions and 17 deletions
|
@ -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
|
;; The binding for `macroexpand' has now been overridden, making psyntax the
|
||||||
;; expander now.
|
;; 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
|
(define-syntax and
|
||||||
(syntax-rules ()
|
(syntax-rules ()
|
||||||
((_) #t)
|
((_) #t)
|
||||||
|
|
|
@ -1115,7 +1115,6 @@
|
||||||
(b (lookup n r mod))
|
(b (lookup n r mod))
|
||||||
(type (binding-type b)))
|
(type (binding-type b)))
|
||||||
(case type
|
(case type
|
||||||
((lexical) (values type (binding-value b) e w s mod))
|
|
||||||
((global) (values type n e w s mod))
|
((global) (values type n e w s mod))
|
||||||
((macro)
|
((macro)
|
||||||
(if for-car?
|
(if for-car?
|
||||||
|
@ -2652,7 +2651,7 @@
|
||||||
#((macro-type . syntax-rules)
|
#((macro-type . syntax-rules)
|
||||||
(patterns pattern ...))
|
(patterns pattern ...))
|
||||||
(syntax-case x (k ...)
|
(syntax-case x (k ...)
|
||||||
((dummy . pattern) #'template)
|
((_ . pattern) #'template)
|
||||||
...)))
|
...)))
|
||||||
((_ (k ...) docstring ((keyword . pattern) template) ...)
|
((_ (k ...) docstring ((keyword . pattern) template) ...)
|
||||||
(string? (syntax->datum #'docstring))
|
(string? (syntax->datum #'docstring))
|
||||||
|
@ -2662,7 +2661,7 @@
|
||||||
#((macro-type . syntax-rules)
|
#((macro-type . syntax-rules)
|
||||||
(patterns pattern ...))
|
(patterns pattern ...))
|
||||||
(syntax-case x (k ...)
|
(syntax-case x (k ...)
|
||||||
((dummy . pattern) #'template)
|
((_ . pattern) #'template)
|
||||||
...))))))
|
...))))))
|
||||||
|
|
||||||
(define-syntax define-syntax-rule
|
(define-syntax define-syntax-rule
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue