Page 1 of 1

about inner function

Posted: Fri May 11, 2012 1:29 am
by andyqu
Can an inner function B, which is inside function A, access variables of A? I searched on google, but found little information about this
:? :? :?

Re: about inner function

Posted: Fri May 11, 2012 8:29 am
by nuntius
Try the following in a CL implementation.

Code: Select all

(defun test (x)
  (let ((a 2))
    (flet ((f (y) (+ a y x)))
      (f x))))