SHARE
TWEET

Untitled

a guest Jun 25th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [235]> (setf f #'abs)               ; I'm ok with this
  2. #<SYSTEM-FUNCTION ABS>
  3.      
  4. [236]> (abs 3)                      ; This is fine
  5. 3
  6.      
  7. [237]> (f 3)                        ; Err due to sep. fn namespace. OK.
  8.      
  9. -- Err[1]: "Undefined function f" --
  10.  
  11. [238]> (#'f 3)                      ; Don't get what this err is telling me...
  12. -- Err[2]: "#'F is not a function name, try using a symbol instead"
  13.      
  14. [239]> (funcall #'f 3)              ; seems very long winded...!
  15. 3
  16.      
  17. CL-USER 54 > (defvar foo 3)
  18. FOO
  19.      
  20. CL-USER 55 > (defun foo (x) (* foo 10))
  21. FOO
  22.      
  23. CL-USER 56 > (foo foo)
  24. 30
  25.      
  26. CL-USER 57 > (fdefinition 'foo)
  27. #<interpreted function FOO 4060001CAC>
  28.  
  29. CL-USER 58 > (symbol-function 'foo)
  30. #<interpreted function FOO 4060001CAC>
  31.      
  32. CL-USER 58a > #'foo
  33. #<interpreted function FOO 4060001CAC>
  34.  
  35. CL-USER 59 > (function foo)            ; works also for local functions
  36. #<interpreted function FOO 4230008AAC>
  37.      
  38. CL-USER 60 > (symbol-value 'foo)
  39. 3
  40.      
  41. CL-USER 61 > foo
  42. 3
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top