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

Re^3: cross combinations (lazy)

by tye (Sage)
on Oct 28, 2005 at 15:08 UTC ( [id://503684]=note: print w/replies, xml ) Need Help??


in reply to Re^2: cross combinations (lazy)
in thread cross combinations

Surely, precalculating the count of items to be returned defeats much of the point of being lazy?

- tye        

Replies are listed 'Best First'.
Re^4: cross combinations (lazy)
by revdiablo (Prior) on Oct 28, 2005 at 16:33 UTC

    Certainly, but the point is that Perl 6 is going to make laziness possible and convenient, not that it will magically change unlazy algorithms to be such. I thought your comment was about Perl 6 more generally than the code in the OP, so my reply was intended to be more general as well. Sorry if there was any misunderstanding.

    Update: Re: tye's reply: explanation understood, but I don't really have any answers to his further questions.

      Certainly, but the point is that Perl 6 is going to make laziness possible and convenient, not that it will magically change unlazy algorithms to be such.

      I appreciate the explanation that gather/take allow laziness. Thank you (didn't you see my upvote?). After learing that, I moved on to wonder at something more specific...

      My point (directly above) was that I'd like to see a reasonable implementation that actually makes using gather/take actually worth using, that actually demonstrates the advantage (actually). It would even be great if that demonstration also showed how easy / natural it is to do that in Perl6 syntax.

      I think I'm (partially) with Perl Mouse in trying to understand the point of this thread in regard to Perl6. So far, it appears to be showing that Perl6 allows alternate syntax which is longer and might support laziness except that it might not by default and nobody has yet been able to demonstrate how to actually support laziness fully; and perhaps that means that Perl6 doesn't support laziness very well since it appears (so far) to make laziness difficult enough that nobody has achieved it.

      I'd be happy to see a version that takes a list of lazy lists and returns a lazy list of lists, and does it without defeating most of the purpose of laziness and (I hope) demonstrates a somewhat natural syntax. I'd also be happy to see a version that takes a lazy list of lazy lists and returns a lazy list of lazy lists, especially if it provided an interesting comparison to the former.

      - tye        

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-26 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found