Note this bug is under Master branch, it's fine in stable-2.0.
I've imported srfi-1, but after some modifications, the program happens not to use any srfi-1 symbols, then there's the problem that one of the rule in syntax-rules can't be found and threw error. It works when I removed useless srfi-1 from imported list. I think srfi-1 here is not related, and maybe the same with syntax-rules. But I can reproduce it with these two prerequisites. I've attached two simplified files(modules) for reproducing. (The code may look not so nice, but it's unrelated, some code looks ugly because of the simplification from my project)
(define-module (xxx mmr) #:export (->sql2)) (define-syntax -> (syntax-rules (end) ((_ end fmt args ...) (format #f "~@?;" fmt args ...)) ((_ fmt args ...) (format #f fmt args ...)))) (define-syntax-rule (->end name arg) (-> end "~a ~a" name arg)) (define-syntax sql-alter (syntax-rules (table rename to add modify drop column as select primary key) ((_ table name drop primary key) (-> "table ~a drop primary key" name)) ((_ table old-name rename to new-name) (-> "table ~a rename to ~a" old-name new-name)) ((_ table name add cname ctype) ;; e.g: (->sql alter table 'mmr add 'cname 'varchar(50)) (-> "table ~a add ~a ~a" cname ctype)) ((_ table name mofify pairs) (-> "table ~a modify (~{~a~^,~})" name (->lst pairs))) ((_ table name drop column cname) (-> "table ~a drop column ~a" name cname)) ((_ table name add primary key keys) (-> "table ~a add primary key (~{~a~^,~})" name keys)) ((_ table name rename column old-name to new-name) (-> "table ~a rename column ~a to ~a" name old-name new-name)))) (define-syntax ->sql2 (syntax-rules (select insert alter create update delete use) ((_ alter rest ...) (->end 'alter (sql-alter rest ...)))))
(define-module (xxx mmr2) #:use-module (xxx mmr) #:use-module (srfi srfi-1) #:export (mmr)) (define mmr (->sql2 alter table 'tname drop primary key))