>> (funcall (compile nil
> #'(lambda ()
> (setf (symbol-function 'foo)
> (let ((foo 0))
> #'(lambda () (incf foo)))))))
This sort of works, only there is a problem in both lucid and
allegro. Suppose that what you'd like to do is:
(funcall (compile nil
#'(lambda ()
(let ((*source-file* "woof"))
(defun foo (x)
(incf x))))))
This works fine except the closure bound to foo is no longer a named
one, so debugging it can be painful. Why would I want to do this?
Suppose I had an emacs interface that wanted to ship a region to the
LISP to get compiled and that region contained a defun.