1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 13:30:26 +02:00

docstrings in syntax-rules

* module/ice-9/psyntax.scm (syntax-rules): Allow a docstring between the
  literals and the first clause.
This commit is contained in:
Andy Wingo 2010-08-29 19:27:23 -07:00
parent e9729cbb2c
commit 44d65b23ce

View file

@ -2607,6 +2607,16 @@
((_ (k ...) ((keyword . pattern) template) ...)
#'(lambda (x)
;; embed patterns as procedure metadata
#((macro-type . syntax-rules)
(patterns pattern ...))
(syntax-case x (k ...)
((dummy . pattern) #'template)
...)))
((_ (k ...) docstring ((keyword . pattern) template) ...)
(string? (syntax->datum #'docstring))
#'(lambda (x)
;; the same, but allow a docstring
docstring
#((macro-type . syntax-rules)
(patterns pattern ...))
(syntax-case x (k ...)