mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 20:45:06 +02:00
Added meta functions
This commit is contained in:
parent
52894f0f29
commit
d4588ecc80
1 changed files with 21 additions and 0 deletions
|
@ -28,10 +28,12 @@
|
||||||
lib:body
|
lib:body
|
||||||
lib:includes
|
lib:includes
|
||||||
lib:import->filename
|
lib:import->filename
|
||||||
|
lib:import->metalist
|
||||||
lib:import->path
|
lib:import->path
|
||||||
lib:read-imports
|
lib:read-imports
|
||||||
lib:import->export-list
|
lib:import->export-list
|
||||||
lib:resolve-imports
|
lib:resolve-imports
|
||||||
|
lib:resolve-meta
|
||||||
lib:get-all-import-deps
|
lib:get-all-import-deps
|
||||||
lib:get-dep-list
|
lib:get-dep-list
|
||||||
)
|
)
|
||||||
|
@ -164,6 +166,25 @@
|
||||||
(lib:import->export-list import))
|
(lib:import->export-list import))
|
||||||
imports)))
|
imports)))
|
||||||
|
|
||||||
|
(define (lib:import->metalist import)
|
||||||
|
(let ((file (lib:import->filename import ".meta"))
|
||||||
|
(fp #f)
|
||||||
|
(result '()))
|
||||||
|
(cond
|
||||||
|
((file-exists? file)
|
||||||
|
(set! fp (open-input-file file))
|
||||||
|
(set! result (car (read-all fp)))
|
||||||
|
(close-input-port fp)))
|
||||||
|
result))
|
||||||
|
|
||||||
|
(define (lib:resolve-meta imports)
|
||||||
|
(apply
|
||||||
|
append
|
||||||
|
(map
|
||||||
|
(lambda (import)
|
||||||
|
(lib:import->metalist import))
|
||||||
|
imports)))
|
||||||
|
|
||||||
;; Given an import set, get all dependant import names that are required
|
;; Given an import set, get all dependant import names that are required
|
||||||
;; The list of deps is intended to be returned in order, such that the
|
;; The list of deps is intended to be returned in order, such that the
|
||||||
;; libraries can be initialized properly in sequence.
|
;; libraries can be initialized properly in sequence.
|
||||||
|
|
Loading…
Add table
Reference in a new issue