[mcclim-cvs] CVS mcclim/Apps/Listener

crhodes crhodes at common-lisp.net
Sun Nov 19 15:31:44 UTC 2006


Update of /project/mcclim/cvsroot/mcclim/Apps/Listener
In directory clnet:/tmp/cvs-serv21288/Apps/Listener

Modified Files:
	listener.lisp 
Log Message:
Whoops.  TYPE is shadowed in the accept method for sequence.  How 
horrible.


--- /project/mcclim/cvsroot/mcclim/Apps/Listener/listener.lisp	2006/11/17 12:30:56	1.28
+++ /project/mcclim/cvsroot/mcclim/Apps/Listener/listener.lisp	2006/11/19 15:31:43	1.29
@@ -175,16 +175,21 @@
 
 (define-presentation-method accept :around
   ((type sequence) stream (view listener-view) &key default default-type)
-  (let* ((token (read-token stream))
-         (result (handler-case (read-from-string token)
-                   (error (c)
-                     (declare (ignore c))
-                     (simple-parse-error 
-                      "Error parsing ~S for presentation type ~S"
-                      token type)))))
-    (if (presentation-typep result type)
-        (values result type)
-        (input-not-of-required-type result type))))
+  ;; oh, my word.  although TYPE here might look like it's bound to
+  ;; the presentation type itself, in fact it is bound to the
+  ;; parameter of the SEQUENCE presentation type.  We need the
+  ;; presentation type itself, so we reconstruct it.
+  (let ((ptype (list 'sequence type)))
+    (let* ((token (read-token stream))
+	   (result (handler-case (read-from-string token)
+		     (error (c)
+		       (declare (ignore c))
+		       (simple-parse-error 
+			"Error parsing ~S for presentation type ~S"
+			token ptype)))))
+      (if (presentation-typep result ptype)
+	  (values result ptype)
+	  (input-not-of-required-type result ptype)))))
 
 ;;; Listener interactor stream.  If only STREAM-PRESENT were
 ;;; specializable on the VIEW argument, this wouldn't be necessary.




More information about the Mcclim-cvs mailing list