
On Mon, Sep 22, 2014 at 12:10 AM, Phil Xiaojun Hu
Think of a network socket as the source of your list, and the first character is all you need. If you need to evaluate the second character to get the first, you could be stuck on the network socket for some time waiting for the second one to come.
That's more of a time leak. I think the space leak aspect comes from the fact that you've evaluated a second list element that was not requested, may never be used, and will be held in the heap until all shared consumers of the list go out of scope. (It may of course also be a time leak if computing that second element is expensive.) -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net