Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Re: Re: (Golf) Dependency List Prioritization

by Sidhekin (Priest)
on Mar 15, 2002 at 10:16 UTC ( [id://152003]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Re: (Golf) Dependency List Prioritization
in thread (Golf) Dependency List Prioritization

Assuming the test harness provided, I doubt anyone can beat this:

sub f{d,c,b,a,f,e}

Try this for a test harness:

my @list = ( a => [ 'b', 'c', 'e' ], b => [ 'd' ], c => [ 'b', 'd' ], f => [ 'a' ], ); print join (',', map { "'$_'" } f(@list)),"\n";

Your code produces 'd','b','c','f','e','a', which does not reflect the fact that 'f' depends on 'a'.

So, I am afraid your solution holds only for a limited set of test harnesses -- and is certainly not the shortest among such solutions.

The Sidhekin
print "Just another Perl ${\(trickster and hacker)},"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://152003]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.