sva49416.scm 608 B

1234567891011121314151617181920212223242526
  1. ;; Savannah bug #49416 "Error macro-expanding with-syntax with ... patterns"
  2. ;; Contributed by AdriánMedraño Calvo
  3. (define-library (somemodule)
  4. (import
  5. (kawa base)
  6. (kawa lib std_syntax))
  7. (begin
  8. (define-syntax some-list
  9. (lambda (stx)
  10. (syntax-case stx ()
  11. ((_ a b rest ...)
  12. (with-syntax (((thelist ...) (syntax (1 2 3))))
  13. (syntax (list thelist ...)))))))
  14. (display 3)
  15. (display (some-list
  16. aaa
  17. bbb
  18. (cons 3 222)
  19. (cons 2 333)))))
  20. (import (somemodule))
  21. (newline)
  22. ;; Output: 3 (1 2 3)