Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: A mini-language for sequences (part 1)

by dragonchild (Archbishop)
on Nov 05, 2004 at 21:27 UTC ( #405646=note: print w/replies, xml ) Need Help??


in reply to Re: A mini-language for sequences (part 1)
in thread A mini-language for sequences (part 1)

I think the gain comes from two things:
  1. You can take an intermediate form of seq_foreach_from_spec() and pass it around, similar to lexical filehandles. (Remember how cool that was when 5.6 added it?)
  2. You can extend it a lot more easily than for-loops. In the trivial case, which is what you're describing, it's very easy to see how the for-for version is easier to handle than the FP version. What if you're working 5-10 nested loops? What if you're working a loop with a bunch of double-nested pairs, all of which are similar?

Let's say that you can create an intermediate representation that allows you to pass in N lists and do XYZ to it. What XYZ does is irrelevant, except to say that you need it done to more than one group of lists. Think about it as templates for algorithms and I think you'll see the gain.

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

  • Comment on Re^2: A mini-language for sequences (part 1)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://405646]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2019-09-16 08:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (186 votes). Check out past polls.

    Notices?