defdfun, defdmacro: Fix reloading.
authorStas Boukarev <stassats@gmail.com>
Fri, 1 Feb 2013 23:44:36 +0000 (03:44 +0400)
committerStas Boukarev <stassats@gmail.com>
Fri, 1 Feb 2013 23:44:36 +0000 (03:44 +0400)
When recompiling an already loaded file, the macroexpansion-time check
for FBOUND prevents the definition to be compiled, and when the resulting
fasl is loaded into a fresh image, the definition will be missing.
Move the fbound check into the expansion itself.

src/default-implementations.lisp

index 0460bb2..7691dad 100644 (file)
@@ -6,15 +6,15 @@
 
 (defmacro defdfun (name args doc &body body)
   `(progn
-     ,(unless (fboundp name)
-       `(defun ,name ,args ,@body))
+     (unless (fboundp ',name)
+       (defun ,name ,args ,@body))
      (setf (documentation ',name 'function)
            (or (documentation ',name 'function) ,doc))))
 
 (defmacro defdmacro (name args doc &body body)
   `(progn
-     ,(unless (fboundp name)
-       `(defmacro ,name ,args ,@body))
+     (unless (fboundp ',name)
+       (defmacro ,name ,args ,@body))
      (setf (documentation ',name 'function)
            (or (documentation ',name 'function) ,doc))))