3 ms·
In sbcl those two work the same.
by throwaway1x31 4y ago
In sbcl those two work the same.
- juki 4y agoThey don't. What aidenn0 said applies to all CL implementations, although with a small correction that it's not "any already compiled forms", but rather any variables/objects that already hold the value of `#'foo` that will keep pointing to the old definition. Compiled code calling `(funcall #'foo ...)` will get the new definition normally (unless `foo` is inlined).
- aidenn0 4y agoDerp, of course it does because (funcall #'foo) evaluates "#'foo" every time it runs. You need to bind (or assign) the value for it to actually show the difference: (defun bar () 3) (defvar *the-fn* #'bar) (defvar *the-sym* 'bar) (defun foo () (funcall *the-fn*)) (defun baz () (funcall *the-sym*)) Then at the REPL: CL-USER> (values (baz) (foo)) 3 3 CL-USER> (defun bar () 2) WARNING: redefining COMMON-LISP-USER::BAR in DEFUN BAR CL-USER> (values (baz) (foo)) 2 3