Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;; Helper macros
- (defmacro defdfun (name args doc &body body)
- `(eval-when (:compile-toplevel :load-toplevel :execute)
- (unless (fboundp ',name)
- ;; Non-executed, non-toplevel DEFUNs cause a bug in SBCL type
- ;; inference, so avoid DEFUN specifically
- #+sbcl (setf (fdefinition ',name) (lambda ,args ,@body))
- #-sbcl (defun ,name ,args ,@body))
- (setf (documentation ',name 'function)
- (or (documentation ',name 'function) ,doc))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement