mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 13:49:17 +02:00
support (import (only (rename ...))) in addition to the other way around (fixes #431)
This commit is contained in:
parent
da28ca8953
commit
2a712b0715
1 changed files with 4 additions and 6 deletions
|
@ -115,15 +115,13 @@
|
||||||
(and (not (eq? 'only (car x)))
|
(and (not (eq? 'only (car x)))
|
||||||
(module-exports
|
(module-exports
|
||||||
(find-module (car mod-name+imports)))))))
|
(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)
|
(cons (car mod-name+imports)
|
||||||
(case (car x)
|
(case (car x)
|
||||||
((only)
|
((only)
|
||||||
|
(if imp-ids
|
||||||
|
(map (lambda (imp) (or (assq imp imp-ids) imp))
|
||||||
(cddr x))
|
(cddr x))
|
||||||
|
(cddr x)))
|
||||||
((except)
|
((except)
|
||||||
(id-filter (lambda (i) (not (memq i (cddr x)))) imp-ids))
|
(id-filter (lambda (i) (not (memq i (cddr x)))) imp-ids))
|
||||||
((rename)
|
((rename)
|
||||||
|
|
Loading…
Add table
Reference in a new issue