]> asedeno.scripts.mit.edu Git - cl-protobufs.git/blobdiff - define-proto.lisp
D'oh, I didn't check in 'defgeneric' in the previous commit,
[cl-protobufs.git] / define-proto.lisp
index 82d504f5d8190bcd014abae8fca1112b53b07158..7db982d7c0b198282b1a218e28a2ed73ee2734b5 100644 (file)
           (when slot
             (let* ((inits  (cdr slot))
                    (sname  (car slot))
-                  (stable (fintern "~A-VALUES" sname))
+                   (stable (fintern "~A-VALUES" sname))
                    (stype  (getf inits :type))
                    (reader (or (getf inits :accessor)
                                (getf inits :reader)
                                  (defmethod ,writer ((object ,type) value)
                                    (declare (type ,stype value))
                                    (setf (gethash object ,stable) value))
-                                ;; For Python compatibility
-                                (defmethod get-extension ((object ,type) (slot (eql ',sname)))
-                                  (gethash object ,stable ,default))
-                                (defmethod set-extension ((object ,type) (slot (eql ',sname)) value)
-                                  (setf (gethash object ,stable) value))
-                                (defmethod has-extension ((object ,type) (slot (eql ',sname)))
-                                  (multiple-value-bind (value foundp)
-                                      (gethash object ,stable ,default)
-                                    (declare (ignore value))
-                                    foundp))
-                                (defmethod clear-extension ((object ,type) (slot (eql ',sname)))
-                                  (remhash object ,stable))
+                                 ;; For Python compatibility
+                                 (defmethod get-extension ((object ,type) (slot (eql ',sname)))
+                                   (values (gethash object ,stable ,default)))
+                                 (defmethod set-extension ((object ,type) (slot (eql ',sname)) value)
+                                   (setf (gethash object ,stable) value))
+                                 (defmethod has-extension ((object ,type) (slot (eql ',sname)))
+                                   (multiple-value-bind (value foundp)
+                                       (gethash object ,stable ,default)
+                                     (declare (ignore value))
+                                     foundp))
+                                 (defmethod clear-extension ((object ,type) (slot (eql ',sname)))
+                                   (remhash object ,stable))
                                  (defsetf ,reader ,writer))))
               ;; This so that (de)serialization works
               (setf (proto-reader field) reader