Evaluate the outer function to generate the closure and return the inner function: ((lambda () (let ((prev-line '())) (lambda (port) (read-line port)))))