In Common Lisp, I can get a function to pass around with the #'
syntax, like this:
(let ((x #'+))
(funcall x 1 2))
But suppose I want to set a function so I don't have to use funcall
for it. Does Common Lisp have a local function name table, or just the global one that is assigned to with defun
?
Is there a way to assign to a function symbol other than defun
? Or more generally: is there a way I can do something similar to this nonworking example:
(setf #'x #'+)
(x 1 2)