Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (declaim (inline foo))
- (defun foo (&rest args)
- (format T "global foo!!! => ~{~A~^ ~}~%" args))
- (defun bar ()
- (list (apply #'foo '(1 2 3))
- (apply 'foo '(1 2 3))))
- (bar)
- ;global foo!!! => 1 2 3
- ;global foo!!! => 1 2 3
- ;; fooを再定義
- (defun foo (&rest args)
- (format T "NEW global foo!!! => ~{~A~^ ~}~%" args))
- (bar)
- ;global foo!!! => 1 2 3 ;昔の定義
- ;NEW global foo!!! => 1 2 3
- ;; not inline
- (declaim (notinline foo))
- (defun foo (&rest args)
- (format T "global foo!!! => ~{~A~^ ~}~%" args))
- (defun bar ()
- (list (apply #'foo '(1 2 3))
- (apply 'foo '(1 2 3))))
- (bar)
- ;global foo!!! => 1 2 3
- ;global foo!!! => 1 2 3
- ;; fooを再定義
- (defun foo (&rest args)
- (format T "NEW global foo!!! => ~{~A~^ ~}~%" args))
- (bar)
- ;NEW global foo!!! => 1 2 3
- ;NEW global foo!!! => 1 2 3
Add Comment
Please, Sign In to add comment