[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
The Lexical Emperor Has No Close
Date: 17 Aug 88 19:17 EST
But here's my question/correction/confusion: That let-bound variable
ISN'T closed over (or whatever the right term is), or anyway kept, in the
lambda definition! It's a free variable! THE GIVEN SOLUTIONS DON'T WORK!
I tried various variants of the solution, finally going over to making it
a macro, but it wound up being very ugly.
Sounds like you are confused. Any non-special variable that is
referenced freely in the lambda-exression but bound in a containing form
is a captured lexical reference.
Are you sure you were using #' (FUNCTION), not ' (QUOTE), to mark the
lambda expression? You have to use the FUNCTION special form to get a
lexical closure; if you just return the lambda expression it will be
evaluated in the null lexical environment.