(in-package :odb) (defclass collection-wrapper () ((collection :accessor collection :initarg :collection :initform nil))) (defmethod collection ((object t)) object) (defmethod get-value ((wrapper collection-wrapper) key) (get-value (collection wrapper) key)) (defmethod (setf get-value) (value (wrapper collection-wrapper) key) (setf (collection wrapper) (map-with-new-kv (collection wrapper) key value))) (defmethod map-without-kv ((wrapper collection-wrapper) key) (prog1 wrapper (setf (collection wrapper) (map-without-kv (collection wrapper) key)))) (defmethod print-object ((wrapper collection-wrapper) stream) (prin1 (collection wrapper) stream))