There is an implicit requirement that BODY be list-structured for the resulting lambda form to be valid. More specifically, a lambda must have one or more body expressions, so a valid BODY must be (a syntax object containing) a non-empty list.
While remaining within the syntax-rules context, an implementation could enforce those requirements like this:
(define-syntax rec
(syntax-rules ()
((rec (NAME . VARIABLES) BODY0 BODY ...)
(letrec ( (NAME (lambda VARIABLES BODY0 BODY ...)) ) NAME))
((rec NAME EXPRESSION)
(letrec ( (NAME EXPRESSION) ) NAME))))
Apparently at least some Schemers around the SRFI 31 era (before my time) preferred the dot operator to ellipses, on the grounds that it is “more
general-purpose,” or perhaps because ellipses did not exist in Lisps without pattern-based macros, which were controversial. I found that in SRFI 5, also, the use of . when the tail is actually constrained to be a proper list obscured subtleties of the specification.
I think it's also fair to say that Scheme macros from this era rarely were concerned with good error reporting, probably because it was very difficult. Letting the target form (lambda, in this case) report the error seems to have been common. Especially with syntax-parse, specifying requirements instead of leaving them implicit pays off in obviously better error messages.
Note that (lambda VARIABLES . BODY) appears in a template.
The dot is not part of the syntax of lambda, but rather for a dotted pair.
E.g. (1 . (2 . ()) is the same as (1 2).
If BODY from the pattern has matched a list, then (lambda VARIABLES . BODY) becomes a list.
but that sound strange because there is a lambda+ in the first pattern and not the other , but the user can use lambda+ in expr.And it would then cause the infix parsing/detection run twice ,one time on the code , another on result,to be tested.....
yes but convention of BODY being a list in not mentioned in the SRFI.
Well, you are looking at an implementation, not the specification.
SRFI 31 Specification
Syntax
The following production rules are to be added to those of [KCR1998] (we reuse names of non-terminals).
<derived expression> --> <rec expression>
<rec expression> --> (rec <variable> <expression>)
<rec expression> --> (rec (<variable>+) <body>)
The syntax uses <body> which is defined in R5RS as: