Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: When should a wheel be reinvented

by exussum0 (Vicar)
on Jun 30, 2004 at 12:56 UTC ( [id://370805]=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 When should a wheel be reinvented

In general...

If it does what you want but can't modify it, you wrap it.
If it's a blackbox, you rewrite it if you have the resources. Blackboxes are dangerous.
If you have the source, you fix it unless it takes too long.

-s

Bart: God, Schmod. I want my monkey-man.

Replies are listed 'Best First'.
Re^2: When should a wheel be reinvented
by tilly (Archbishop) on Jun 30, 2004 at 22:16 UTC
    You cannot generally wrap a callback interface with a looping interface unless you have continuations, co-routines, or some other similar construct. Perl does not. (Well, there is a module that adds it, but I'm not sure what issues it has. Certainly it isn't a built-in feature.)

    Whether it is good for a language to have continuations is another debate, and there are top-notch people who'll argue both sides of that choice.

    Regardless, Perl 6 will have continuations.

      Here, here. See this node for some further discussion (which, in fact, also happens to mention File::Find and it's callback-based interface).
      ------------ :Wq Not an editor command: Wq
        If you're motivated, I'd suggest trying to find some of Dominus' comments on File::Find. His opinion seems to resemble yours - File::Find works well except that the API can be very inconvenient. IIRC his book (which should be coming out really soon...) on higher-order Perl implements an iterator-based equivalent to File::Find.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://370805]
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.