LIPS-scheme / lips

Scheme based powerful lisp interpreter in JavaScript
https://lips.js.org
Other
427 stars 35 forks source link

Improper syntax-rules patterns #360

Closed jcubic closed 6 months ago

jcubic commented 7 months ago

Handle code from the Scheme survey.

(define-syntax f
  (syntax-rules ()
    ((f a ... x . y)
     (begin (begin (write a) (display " ")
                   (write x) (display " ")
                   (write y) (display " ")
                   (newline)) ...))))

(f 10 20 30 'a 'b)

Should print:

10 b ()
20 b ()
30 b ()
a b ()