Guest User

Untitled

a guest
Feb 21st, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. (declaim (inline foo))
  2. (defun foo (&rest args)
  3. (format T "global foo!!! => ~{~A~^ ~}~%" args))
  4.  
  5. (defun bar ()
  6. (list (apply #'foo '(1 2 3))
  7. (apply 'foo '(1 2 3))))
  8.  
  9. (bar)
  10. ;global foo!!! => 1 2 3
  11. ;global foo!!! => 1 2 3
  12.  
  13. ;; fooを再定義
  14. (defun foo (&rest args)
  15. (format T "NEW global foo!!! => ~{~A~^ ~}~%" args))
  16.  
  17. (bar)
  18. ;global foo!!! => 1 2 3 ;昔の定義
  19. ;NEW global foo!!! => 1 2 3
  20.  
  21.  
  22. ;; not inline
  23. (declaim (notinline foo))
  24. (defun foo (&rest args)
  25. (format T "global foo!!! => ~{~A~^ ~}~%" args))
  26.  
  27. (defun bar ()
  28. (list (apply #'foo '(1 2 3))
  29. (apply 'foo '(1 2 3))))
  30.  
  31. (bar)
  32. ;global foo!!! => 1 2 3
  33. ;global foo!!! => 1 2 3
  34.  
  35. ;; fooを再定義
  36. (defun foo (&rest args)
  37. (format T "NEW global foo!!! => ~{~A~^ ~}~%" args))
  38.  
  39. (bar)
  40. ;NEW global foo!!! => 1 2 3
  41. ;NEW global foo!!! => 1 2 3
Add Comment
Please, Sign In to add comment