* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-46.
* doc/ref/srfi-modules.texi (SRFI-0): Add srfi-46 to the list of core
features.
(SRFI-46): New node.
* doc/ref/api-macros.texi (Syntax Rules): Mention that the custom
ellipsis identifier support is specified by SRFI-46.
* test-suite/tests/syntax.test ("syntax-rules"): Add ellipsis hygiene
test from SRFI-46.
@c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual.
-@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2011, 2012, 2013
-@c Free Software Foundation, Inc.
+@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2011,
+@c 2012, 2013, 2014 Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
@node Macros
When writing macros that generate macro definitions, it is convenient to
use a different ellipsis identifier at each level. Guile allows the
desired ellipsis identifier to be specified as the first operand to
-@code{syntax-rules}, as per R7RS. For example:
+@code{syntax-rules}, as specified by SRFI-46 and R7RS. For example:
@example
(define-syntax define-quotation-macros
* SRFI-41:: Streams.
* SRFI-42:: Eager comprehensions
* SRFI-45:: Primitives for expressing iterative lazy algorithms
+* SRFI-46:: Basic syntax-rules Extensions.
* SRFI-55:: Requiring Features.
* SRFI-60:: Integers as bits.
* SRFI-61:: A more general `cond' clause
srfi-23
srfi-30
srfi-39
+srfi-46
srfi-55
srfi-61
srfi-62
wrap procedure bodies with @code{(lazy ...)}.
@end itemize
+@node SRFI-46
+@subsection SRFI-46 Basic syntax-rules Extensions
+@cindex SRFI-46
+
+Guile's core @code{syntax-rules} supports the extensions specified by
+SRFI-46/R7RS. Tail patterns have been supported since at least Guile
+2.0, and custom ellipsis identifiers have been supported since Guile
+2.0.10. @xref{Syntax Rules}.
+
@node SRFI-55
@subsection SRFI-55 - Requiring Features
@cindex SRFI-55
srfi-23 ;; `error` procedure
srfi-30 ;; nested multi-line comments
srfi-39 ;; parameterize
+ srfi-46 ;; basic syntax-rules extensions
srfi-55 ;; require-extension
srfi-61 ;; general cond clause
srfi-62 ;; s-expression comments
;;;; syntax.test --- test suite for Guile's syntactic forms -*- scheme -*-
;;;;
;;;; Copyright (C) 2001, 2003, 2004, 2005, 2006, 2009, 2010,
-;;;; 2011, 2012, 2013 Free Software Foundation, Inc.
+;;;; 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
'((((x y) …) ...)
(((x y) ...) …)))))))
(define-syntax bar (foo x y z))
- (bar a b c))))
+ (bar a b c)))
+
+ ;; This test is given in SRFI-46.
+ (pass-if-equal "custom ellipsis is handled hygienically"
+ '((1) 2 (3) (4))
+ (let-syntax
+ ((f (syntax-rules ()
+ ((f ?e)
+ (let-syntax
+ ((g (syntax-rules --- ()
+ ((g (??x ?e) (??y ---))
+ '((??x) ?e (??y) ---)))))
+ (g (1 2) (3 4)))))))
+ (f ---))))
(with-test-prefix "syntax-error"