![]() |
|
Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
Tom, this isn't critism (yet:). Your's is a long article that will take several passes to fully appreciate. But.. :) I recognised this problem. Now comparing your code with my own solution which both arrive at the same results:
And
The thing that struck me was that my perl version would be reasonably clear to most people with more than a passing familiarity with perl. Whereas your version...? Apart from the need to go off looking up the purpose, and parameters of seq_foreach_from_spec(), seq_foreach() and seq_zip(). (Oh! and seq(). Nearly missed that tucked away in there). That "one line" construction? Phew! I'm not adverse to terse or complicated code, but anonymous subs and user subs nested inside user subs; nested inside anonymous subs, inside a user sub along with an anon. array of array references. When I encountered that line, the only way I could begin to makes sense of it was to deconstruct the one line into 3 for 4 using temporaries and it still left me cold? Maybe if I work through the stuff again it'll make it easier. But given that it almost exactly the same number of lines/bytes of code; I doubt it is any quicker; certainly isn't clearer; what, besides novelty value and a cool implementation of FP, is the point? Please don't misread that. It is a question, not a statement. I keep reading about FP, and have now installed 3 different FP langauges and downloaded 4 FP/langauge books trying to get what people are raving about. So far, FP is interesting, and in some ways quite elegant, but it is also way over sold in some aspects. And I have to say, beyond encouraging me to continue to make full use of map, grep and List::Util where they fit, which I've taken some critisism for in the past, I don't quite get the idea of going further with FP in Perl? In reply to Re: A mini-language for sequences (part 1)
by BrowserUk
|
|