I believe this is a bug in Chicken 4.  It works in Chicken 3 with the
syntax-case egg, and in Scheme 48.  It looks like an ellipsis form
matches after just checking the first pattern, without checking
subsequent patterns.

(define-syntax foo
    (syntax-rules () ((_ (a b) ...)
                      (list '(a b) ...))
                     ((_ a ...)
                      (list '(a) ...))))

Chicken 4, native syntax-rules

#;2> (foo (1 2) (3 4) (5 6))
((1 2) (3 4) (5 6))
#;3> (foo (1 2) (3) (5 6))
Error: (car) during expansion of (foo ...) - bad argument type: ()

Chicken 3 w/ syntax-case egg, and Scheme 48:

#;2> (foo (1 2) (3 4) (5 6))
((1 2) (3 4) (5 6))
#;3> (foo (1 2) (3) (5 6))
(((1 2)) ((3)) ((5 6)))


_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to