Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Derp, 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


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: