"be consistent" | |
PerlMonks |
Re^9: Near-free function currying in Perlby dragonchild (Archbishop) |
on Nov 18, 2004 at 12:57 UTC ( [id://408755]=note: print w/replies, xml ) | Need Help?? |
I think you're missing the point - 90% of all Perl programmers will never know that you can take a reference to a subroutine. To them, currying is a very advanced technique. In fact, it's almost to the point of inscrutability. It's because of this that I would hesitate to ever use any form of currying at most jobs I've been at, regardless of whether or not I had need for it.
Now, granted, once you grok references, currying is far less complicated than inside-out objects. It's nothing more than fancy caching, just like you said. And, if you know that your maintainers will all be in that 10% of Perl programmers, then it's no more complicated than the map-sort-map of the ST. As for what Perl might break ... you just might be right. Anything that depends on caller(), B::*, or is sufficiently introspective will probably have issues. But, I've been testing out my Currying implementation based on attributes and it seems to be taking everything I've been throwing at it. A few of the crazier things have been:
It didn't handle the following, but I think that's because of me screwing up the attribute handler. That created an infinite loop, but I'm not sure why. Being right, does not endow the right to be rude; politeness costs nothing.
In Section
Meditations
|
|