mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 00:07:36 +02:00
Filter export lists for (only) and (except)
This commit is contained in:
parent
8f7a56a3ef
commit
7caace8f13
1 changed files with 14 additions and 1 deletions
|
@ -222,7 +222,20 @@
|
|||
(lib (read-all fp))
|
||||
(exports (lib:exports (car lib))))
|
||||
(close-input-port fp)
|
||||
exports))
|
||||
(cond
|
||||
((tagged-list? 'only import)
|
||||
;; Filter to symbols from "only" that appear in export list
|
||||
(filter
|
||||
(lambda (sym)
|
||||
(member sym exports))
|
||||
(cddr import)))
|
||||
((tagged-list? 'except import)
|
||||
(filter
|
||||
(lambda (sym)
|
||||
(not (member sym (cddr import))))
|
||||
exports))
|
||||
(else
|
||||
exports))))
|
||||
|
||||
;; Take a list of imports and resolve it to the imported vars
|
||||
(define (lib:resolve-imports imports)
|
||||
|
|
Loading…
Add table
Reference in a new issue