From cf5da3ed13705b910dc596c99382707c801dff49 Mon Sep 17 00:00:00 2001 From: Drew Crampsie Date: Fri, 21 Oct 2005 16:12:23 -0700 Subject: [PATCH] Added a make-presentation for a LIST argument. darcs-hash:20051021231223-5417e-099170989ffdf236283c83f027eda81f9c8bbeb2.gz --- src/mewa/mewa.lisp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/mewa/mewa.lisp b/src/mewa/mewa.lisp index 255ce57..cf6ea00 100644 --- a/src/mewa/mewa.lisp +++ b/src/mewa/mewa.lisp @@ -315,7 +315,8 @@ attributes is an alist keyed on the attribute name." (classes self)))) (setf (attribute-slot-map self) (find-slot-presentations self)) (setf (slots self) (mapcar #'(lambda (x)(cdr x)) (attribute-slot-map self ))))) - + + (defmethod make-presentation ((object t) &key (type :viewer) (initargs nil)) (let* ((p (make-instance 'mewa-object-presentation)) (a (progn (setf (slot-value p 'instance) object) @@ -334,6 +335,15 @@ attributes is an alist keyed on the attribute name." (setf (slot-value i 'initializedp) t) i)) +(defmethod make-presentation ((list list) &key (type :listing) (initargs nil)) + + (let ((args (append + `(:type ,type) + `(:initargs + (:instances ,list + ,@initargs))))) + + (apply #'make-presentation (car list) args))) (defmethod initialize-slots-place ((place ucw::place) (mewa mewa)) (setf (slots mewa) (mapcar #'(lambda (x) -- 2.20.1