support (import (only (rename ...))) in addition to the other way around (fixes #431)

This commit is contained in:
Alex Shinn 2017-08-05 17:31:24 +09:00
parent da28ca8953
commit 2a712b0715

View file

@ -115,15 +115,13 @@
(and (not (eq? 'only (car x)))
(module-exports
(find-module (car mod-name+imports)))))))
;; (if (not (eq? 'only (car x)))
;; (let ((unbound
;; (id-filter (lambda (i) (not (memq i imp-ids))) (cddr x))))
;; (if (pair? unbound)
;; (warn "import excepting unbound identifiers" unbound))))
(cons (car mod-name+imports)
(case (car x)
((only)
(cddr x))
(if imp-ids
(map (lambda (imp) (or (assq imp imp-ids) imp))
(cddr x))
(cddr x)))
((except)
(id-filter (lambda (i) (not (memq i (cddr x)))) imp-ids))
((rename)