Topological sort/Extracted top item: Difference between revisions
Topological sort/Extracted top item (view source)
Revision as of 16:33, 13 October 2010
, 13 years agoJ: group dependencies by dependency level
(J: bug fix -- include files we depend on which themselves depend on nothing) |
(J: group dependencies by dependency level) |
||
Line 49:
depends=. (+. +./ .*.~)^:_ depends
keep=. +./depends (] , #~) names e. targets
>names ((<@(;:inv)/.~ /:
)</lang>
Line 58:
# Make sure that things we can depend on are included in our dependency structures
# Select these targets, and the things they depend on, once we know what depends on what
# When ordering names by dependencies
## only consider names and dependencies we want to keep
## group names by how many dependencies they have
## sort strings of names by how many dependencies they have
Example:
Line 72 ⟶ 75:
)
extra1 ip1a ipcommon ip2a ip2b ip2c des1b des1a1 des1a2 des1c1
des1a des1c
ip1
ip2
des1
top1
▲top1 </lang>
=={{header|Python}}==
|