Sorry if this has been discussed before; if so, I appreciate a pointer.
Is this allowed according to the R6RS:
(syntax-case #'123 ()
[(x* ... . r)
(syntax->datum #'r)])
=> 123
??
Chapter 12.4 of R6RS-Libraries says:
More formally, an input form F matches a pattern P if and only
if one of the following holds:
...
P is of the form (P1 ... Pk Pe <ellipsis> Pm+1 ... Pn . Px),
where <ellipsis> is the identifier ... and F is a list or
improper list of n elements whose first k elements match P1
through Pk, whose next m - k elements each match Pe, whose next
n - m elements match Pm+1 through Pn, and whose nth and final
cdr matches Px.
Which for this behavior, I read the critical parts as "... if and only
if ... F is a list or improper list ... whose ... final cdr matches Px".
So doesn't that say the example I gave above is not allowed? But the
behavior of that example seems to be standard behavior and makes sense,
so is the report incomplete about this?
Chez, Larceny, MzScheme, and Ikarus (and maybe more?) all do allow the
(x* ... . r) pattern to match anything.
Thanks for clarification,
--
: Derick
----------------------------------------------------------------
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss