allow update-record-from-slots to accept slot names or slot
authorRuss Tyndall <russ@acceleration.net>
Thu, 9 Jun 2011 18:04:47 +0000 (14:04 -0400)
committerNathan Bird <nathan@acceleration.net>
Thu, 30 Jun 2011 20:56:29 +0000 (16:56 -0400)
definitions (by improving slotdef-for-slot-with-class)

sql/metaclasses.lisp

index 6ee6d4d062062c536035f297e5a1d337e4b194e3..81a430c59f1c584a231e2d27fef94c87c081958f 100644 (file)
@@ -573,8 +573,11 @@ implementations."
     result))
 
 (defun slotdef-for-slot-with-class (slot class)
-  (find-if #'(lambda (d) (eql slot (slot-definition-name d)))
-           (class-slots class)))
+  (typecase slot
+    (standard-slot-definition slot)
+    (symbol
+     (find-if #'(lambda (d) (eql slot (slot-definition-name d)))
+              (class-slots class)))))
 
 #+ignore
 (eval-when (:compile-toplevel :load-toplevel :execute)