Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
15
Task/Topological-sort/PicoLisp/topological-sort.l
Normal file
15
Task/Topological-sort/PicoLisp/topological-sort.l
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
(de sortDependencies (Lst)
|
||||
(setq Lst # Build a flat list
|
||||
(uniq
|
||||
(mapcan
|
||||
'((L)
|
||||
(put (car L) 'dep (cdr L)) # Store dependencies in 'dep' properties
|
||||
(copy L) )
|
||||
(mapcar uniq Lst) ) ) ) # without self-dependencies
|
||||
(make
|
||||
(while Lst
|
||||
(ifn (find '((This) (not (: dep))) Lst) # Found non-depending lib?
|
||||
(quit "Can't resolve dependencies" Lst)
|
||||
(del (link @) 'Lst) # Yes: Store in result
|
||||
(for This Lst # and remove from 'dep's
|
||||
(=: dep (delete @ (: dep))) ) ) ) ) )
|
||||
Loading…
Add table
Add a link
Reference in a new issue