mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-11 23:07:36 +02:00
WIP - dependency chain
This commit is contained in:
parent
c532b8530e
commit
4e4eff037e
1 changed files with 24 additions and 16 deletions
40
trans.scm
40
trans.scm
|
@ -1720,22 +1720,30 @@
|
||||||
;;
|
;;
|
||||||
;; TODO: this is not working at the moment!!!
|
;; TODO: this is not working at the moment!!!
|
||||||
(define (lib:get-dep-list libs/deps)
|
(define (lib:get-dep-list libs/deps)
|
||||||
(let* ((result '())
|
;for each library
|
||||||
(add-result!
|
; compute index of result that is after any libs that lib imports
|
||||||
(lambda (name)
|
; compute index of result that is before any libs that import lib
|
||||||
(cond
|
; if there is a 'hole' then insert lib into result in that space
|
||||||
((not (member name result))
|
; otherwise, throw an error (unfortunate but best we can do right now)
|
||||||
(set! result (cons name result)))
|
|
||||||
(else
|
; (let* ((result '())
|
||||||
;; TODO: library already added, make sure it is after its deps
|
; (add-result!
|
||||||
'TODO)))))
|
; (lambda (name)
|
||||||
(for-each
|
; (cond
|
||||||
(lambda (lib/deps)
|
; ((not (member name result))
|
||||||
(let ((lib (car lib/deps))
|
;(write `(DEBUG adding ,name))
|
||||||
(deps (cdr lib/deps)))
|
;(newline)
|
||||||
(for-each add-result! (cons lib deps))))
|
; (set! result (cons name result)))
|
||||||
libs/deps)
|
; (else
|
||||||
result))
|
; ;; TODO: library already added, make sure it is after its deps
|
||||||
|
; 'TODO)))))
|
||||||
|
; (for-each
|
||||||
|
; (lambda (lib/deps)
|
||||||
|
; (let ((lib (car lib/deps))
|
||||||
|
; (deps (cdr lib/deps)))
|
||||||
|
; (for-each add-result! (cons lib deps))))
|
||||||
|
; libs/deps)
|
||||||
|
; result))
|
||||||
; Notes for above 2 functions:
|
; Notes for above 2 functions:
|
||||||
;
|
;
|
||||||
; Testing, run this from hello directory:
|
; Testing, run this from hello directory:
|
||||||
|
|
Loading…
Add table
Reference in a new issue