X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/blobdiff_plain/1da9fd46aa8f2d6f877a1347f18cbc1507b0aadb..d75822e6994bf139e0ba2fddf3eee28e0cda5f2c:/src/meta-model.lisp diff --git a/src/meta-model.lisp b/src/meta-model.lisp index 8705a68..aabd2ff 100644 --- a/src/meta-model.lisp +++ b/src/meta-model.lisp @@ -22,6 +22,9 @@ (defmethod meta-model.metadata ((self (eql nil))) nil) +(defmethod meta-model.metadata ((self symbol)) + (meta-model.metadata (make-instance self))) + (defun gen-supers (supers) (let (subclassp) (dolist (x supers) @@ -55,6 +58,9 @@ (class-name (class-of (meta-model.instance model)))) (defmethod view-class-metadata ((model t)) + " +This is what meta-model.metadata used to be called, +most of the below functions expect this method to exist" (meta-model.metadata model)) (defun list-item-helper (type view &key (ret-fun #'car)) @@ -209,14 +215,18 @@ (defgeneric select-instances (instance &rest args) (:documentation "Select instances in backend dependent way")) +(defgeneric prepare-slot-name-for-select (instance slot-name) + (:method (i s) s)) + (defmacro def-compare-expr (instance-type name expr &key value-format) `(defmethod ,name ((instance ,instance-type) slot-name value) (declare (ignore instance)) - (,expr slot-name ,(typecase value-format + (,expr (prepare-slot-name-for-select instance slot-name) ,(typecase value-format (null 'value) (string `(format nil ,value-format value)) (t `(,value-format value)))))) + (defmacro def-logical-expr (instance-type name expr) `(defmethod ,name ((instance ,instance-type) &rest args) (declare (ignore instance))