Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Infinitely Lazy

by halley (Prior)
on Feb 07, 2005 at 19:31 UTC ( #428789=note: print w/replies, xml ) Need Help??

in reply to Infinitely Lazy

I think I might divine what you mean by 'lazy lists' in this example, but maybe you'd give the "fifty words or less" overview of what they are, and maybe a little more to explain why you'd want to implement them at all?

I don't follow Perl 6 development too closely, but I feel like after the Apocalypse 5, things have been going damned goofy in the design of Perl 6. It seems to me that while Perl 5 is trying to be pragmatic and primordial, Perl 6 is bloating up on every "interesting" computer science concept that strikes some developer's fancy.

Perl 6 is shaping up to be the Prego of the computing world: you want it, it's in there. Will this help admins script their glue and read other people's scripts? Or will it impede adoption by being too esoteric and diverse?

[ e d @ h a l l e y . c c ]

Replies are listed 'Best First'.
Re^2: Infinitely Lazy
by sleepingsquirrel (Hermit) on Feb 07, 2005 at 19:51 UTC
    Maybe Lazy Evaluation would be a good place to jump in?

    -- All code is 100% tested and functional unless otherwise noted.
Re^2: Infinitely Lazy
by sleepingsquirrel (Hermit) on Feb 07, 2005 at 23:58 UTC
    Although I haven't seen it myself, maybe chapters 3 & 6 of Higher-Order Perl will provide additional motivation.

    -- All code is 100% tested and functional unless otherwise noted.
Re^2: Infinitely Lazy
by bunnyman (Hermit) on Feb 08, 2005 at 16:40 UTC

    Lazy evaluation isn't esoteric and unfamiliar. If you have ever written $foo = $ENV{"FOO"} || "foo"; then you have used it.

    Ever seen this code before?

    if(grep /needle/, @haystack) { print "found it! }

    If @haystack is large and begins with "needle", then this code is searching the entire array even though it has enough information to stop after the first element. If grep were using lazy evaluation, then this code could go faster.


    @matches = ( grep /$pattern/, @ReallyBigList )[ 0 .. $n ];

    This code gets the first $n matches in the list, but Perl is not smart enough to know it is allowed to stop searching after it has enough matches. It will search down the entire list no matter what. Lazy evaluation would be nice here too.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://428789]
[choroba]: again a pilot?
[marto]: yeah, the whole infrastructure has changed, and video codecs have moved on a great deal
[Corion]: marto: Redoing something on new infrastructure sounds fun. At least you can reuse your previous experience :)
[marto]: I'm looking forwads to it. The video sources are dying, and they don't have the hardware to play them back (old tape formats, not just VHS + Laserdisc etc)

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2017-07-28 09:15 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (425 votes). Check out past polls.