From 44d65b23cebad7001d0384ed181a44b500129f83 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sun, 29 Aug 2010 19:27:23 -0700 Subject: [PATCH] docstrings in syntax-rules * module/ice-9/psyntax.scm (syntax-rules): Allow a docstring between the literals and the first clause. --- module/ice-9/psyntax.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/module/ice-9/psyntax.scm b/module/ice-9/psyntax.scm index 69cd1a584..6c96bdbd6 100644 --- a/module/ice-9/psyntax.scm +++ b/module/ice-9/psyntax.scm @@ -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 ...)