mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 19:50:24 +02:00
add define-syntax-rule
* module/ice-9/psyntax.scm (define-syntax-rule): Add this new helper macro, to define a syntax-rules macro with one clause. * module/ice-9/psyntax-pp.scm: Regenerate.
This commit is contained in:
parent
0b4f77192d
commit
dea14eb99b
2 changed files with 1639 additions and 1506 deletions
File diff suppressed because it is too large
Load diff
|
@ -2662,6 +2662,20 @@
|
||||||
((dummy . pattern) #'template)
|
((dummy . pattern) #'template)
|
||||||
...))))))
|
...))))))
|
||||||
|
|
||||||
|
(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 let*
|
(define-syntax let*
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
(syntax-case x ()
|
(syntax-case x ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue