X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/blobdiff_plain/835ac88dcdbdb3389dd922748d31546875b1599a..5f0b37e7a9a8e95dd5a846bfa7896af5875b91f7:/src/meta-model.lisp diff --git a/src/meta-model.lisp b/src/meta-model.lisp index 2fbe4b5..4416423 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) @@ -99,7 +102,7 @@ most of the below functions expect this method to exist" (list-item-helper type view :ret-fun #'rfun))) - (append (lister :key) (lister :base)))) + (append (lister :key) (lister :base) (lister nil)))) (defmethod slot-type ((view t) slot) "returns the CLSQL type of SLOT" @@ -212,14 +215,18 @@ most of the below functions expect this method to exist" (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))