1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +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:
Andy Wingo 2011-09-02 11:28:11 +02:00
parent 0b4f77192d
commit dea14eb99b
2 changed files with 1639 additions and 1506 deletions

File diff suppressed because it is too large Load diff

View file

@ -2662,6 +2662,20 @@
((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*
(lambda (x)
(syntax-case x ()