This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

about inner function

2 posts · 1642 views

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

Try the following in a CL implementation.
(defun test (x)
  (let ((a 2))
    (flet ((f (y) (+ a y x)))
      (f x))))