R7RS syntax-rules doesn't allow dot after ellipsis

Create issue
Issue #64 resolved
Takashi Kato repo owner created an issue

This is valid R7RS program but raises an error.

(import (scheme base) (scheme write))

(define-syntax extract-last
  (syntax-rules ()
    ((_ (bogus ... . last))
     'last)
    ((_ bogus) "error")))

(define-syntax test
  (syntax-rules ()
    ((_ arg)
     (begin
       (write (list '(extract-last arg) '= (extract-last arg)))
       (newline)))))

(test (0 . 1)) ;; => 1
(test (1 0)) ;; => nil
(test ()) ;; => nil
(test 1) ;; => 1 

Comments (1)

  1. Log in to comment