On Nov 10, 9:19 am, marcomaggi <[EMAIL PROTECTED]> wrote:
> This is different from what Guile does, and it is
> probably related to the fact that Guile (up to 1.8) has no real
> hygiene.
This is not related to hygiene, but to the strategy used by the
implementation.
For instance Chicken works like Guile when interpreted (no need to put
helpers
in a separate module) but like Ikarus when compiled.
> I understand why it works but not why your proposal should be
> better; both the ". rest" and "rest ..." subpatterns match zero or
> more elements of the input, and here they both appear in cdr
> position and we take the whole "rest" we do not need to
> destructure it.
Notice that (first arg ...) only matches a *proper* list, whereas
(first . args)
also matches an *improper* list. For instance
> (def-syntax (f . args) #''args)
> (f 1 2)
(1 2)
> (f 1 . 2)
(1 . 2)
accept the improper list '(1 . 2) but
> (def-syntax (g arg ...) #''(arg ...))
> (g a)
(a)
does not accept it:
> (g a . b)
Unhandled exception
Condition components:
1. &message: "invalid syntax"
2. &syntax:
form: (g a . b)
subform: #f
3. &trace: #<syntax (g a . b)>
(def-syntax is a shortcut for the standard syntax-case expression, see
for instance
http://www.artima.com/weblogs/viewpost.jsp?thread=240804).
Michele Simionato