Advertisement
Guest User

Untitled

a guest
May 17th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.48 KB | None | 0 0
  1. ;;; Helper macros
  2.  
  3. (defmacro defdfun (name args doc &body body)
  4.   `(eval-when (:compile-toplevel :load-toplevel :execute)
  5.      (unless (fboundp ',name)
  6.        ;; Non-executed, non-toplevel DEFUNs cause a bug in SBCL type
  7.        ;; inference, so avoid DEFUN specifically
  8.        #+sbcl (setf (fdefinition ',name) (lambda ,args ,@body))
  9.        #-sbcl (defun ,name ,args ,@body))
  10.      (setf (documentation ',name 'function)
  11.            (or (documentation ',name 'function) ,doc))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement