Why does my lazy filtered list in scheme consume so much memory?
问题 I'm currently learning to use some slightly more advanced features of scheme, and I've hit a road-block with lazy lists. Basically, I'm trying to create an infinite, lazily generated list, and apply a lazy filter on it, and only take a single element. My hope was that this would consume very little memory: the filter looks at only one element at a time, and there's no need to store the previous entries. Here is my attempt at this: (define lazy-inf-seq (lambda (start next) (delay (cons start