http://qs1969.pair.com?node_id=427863


in reply to Re^5: Better mousetrap (getting top N values from list X)
in thread Better mousetrap (getting top N values from list X)

True, but you still need the whole list for the first pass.


Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.
  • Comment on Re^6: Better mousetrap (getting top N values from list X)

Replies are listed 'Best First'.
Re^7: Better mousetrap (getting top N values from list X)
by sleepingsquirrel (Hermit) on Feb 03, 2005 at 23:29 UTC
    So?


    -- All code is 100% tested and functional unless otherwise noted.

      So,...you said:

      ...if you had lazy lists (coming in perl6)...

      And I couldn't see how lazy lists would benefit this problem; hence my original question (way back up there^^^ somewhere).


      Examine what is said, not who speaks.
      Silence betokens consent.
      Love the truth but pardon error.
        You're correct, sort is strict on its input arguments (i.e. it has to evaluate each one), but the importance of laziness comes about because the output is a lazy list.


        -- All code is 100% tested and functional unless otherwise noted.