Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [235]> (setf f #'abs) ; I'm ok with this
- #<SYSTEM-FUNCTION ABS>
- [236]> (abs 3) ; This is fine
- 3
- [237]> (f 3) ; Err due to sep. fn namespace. OK.
- -- Err[1]: "Undefined function f" --
- [238]> (#'f 3) ; Don't get what this err is telling me...
- -- Err[2]: "#'F is not a function name, try using a symbol instead"
- [239]> (funcall #'f 3) ; seems very long winded...!
- 3
- CL-USER 54 > (defvar foo 3)
- FOO
- CL-USER 55 > (defun foo (x) (* foo 10))
- FOO
- CL-USER 56 > (foo foo)
- 30
- CL-USER 57 > (fdefinition 'foo)
- #<interpreted function FOO 4060001CAC>
- CL-USER 58 > (symbol-function 'foo)
- #<interpreted function FOO 4060001CAC>
- CL-USER 58a > #'foo
- #<interpreted function FOO 4060001CAC>
- CL-USER 59 > (function foo) ; works also for local functions
- #<interpreted function FOO 4230008AAC>
- CL-USER 60 > (symbol-value 'foo)
- 3
- CL-USER 61 > foo
- 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement