Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defmacro mfoo () '(lambda (z) (1+ z)))
- ;; f-macro, f-symb-macro, f-macrolet have a function call to a compiled lambda in disassembly
- (defun f-macro (x)
- (declare (optimize (speed 3) (safety 0) (debug 0)))
- (funcall (mfoo) x))
- (defun f-symb-macro (x)
- (declare (optimize (speed 3) (safety 0) (debug 0)))
- (symbol-macrolet ((mfoo-new (lambda (z) (1+ z))))
- (funcall mfoo-new x)))
- (defun f-macrolet (x)
- (declare (optimize (speed 3) (safety 0) (debug 0)))
- (macrolet ((mfoo-new () '(lambda (z) (1+ z))))
- (funcall (mfoo-new) x)))
- ;; f-bare and f-flet-macro have the same disassembly, and both call
- ;; #'1+ directly
- (defun f-bare (x)
- (declare (optimize (speed 3) (safety 0) (debug 0)))
- (funcall (lambda (z) (1+ z)) x))
- (defun f-flet-macro (x)
- (declare (optimize (speed 3) (safety 0) (debug 0)))
- (flet ((f (x) (funcall (mfoo) x)))
- (funcall #'f x)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement