News for hackers. Stuff that matters.
Re:A lambda is not necessarily a closure by bandrami on Monday February 08, 2016 @11:48PM (#11063152)
Even passing over that, it's only a closure if it keeps a lexical environment.

(lambda (x) (+ x 1)) doesn't close over anything, so it's not a closure, nor does it evaluate to one. For that matter, (let ((x 0)) (lambda (x) (+ x 1))) isn't really a closure in any sense because the environment can be inlined out.

Re:A lambda is not necessarily a closure by waldrews on Tuesday February 09, 2016 @01:17AM (#11063489)
Doesn't (lambda (x) (+ x 1)) capture +? You could evaluate (lambda (x) (+ x 1)) in a scope of, say, (let ((+ *)) (lambda (x) (+ x 1))) - in some lisps.
Re:A lambda is not necessarily a closure by bandrami on Tuesday February 09, 2016 @02:09AM (#11063657)
Ah, I guess in Scheme it does (I use Common Lisp, where the two namespaces are different). But even then you would need the actual environment there for it to be a closure. The lambda expression is only half of a closure. It's "let over lambda" that is a closure.
Re:A lambda is not necessarily a closure by agumonkey on Tuesday February 09, 2016 @12:17AM (#11063276)
I call them free closures.