[mcclim-devel] Presenting pathnames

Robert Goldman rpgoldman at real-time.com
Fri Jan 5 20:37:41 UTC 2007


In presentation-defs.lisp there's some code that stuffs :wild into the
name field of pathnames before presenting them, together with a comment
that says that pathnames can't be represented if they don't have names.
 I have checked, and pathnames can be printed w/o names, at least on
SBCL and ACL.  Adding random stuff to the pathname also seems a little
like the wrong thing to do.  Would the following patch be appropriate:

Index: presentation-defs.lisp
===================================================================
RCS file: /project/mcclim/cvsroot/mcclim/presentation-defs.lisp,v
retrieving revision 1.65
diff -b -u -F^(def -r1.65 presentation-defs.lisp
--- presentation-defs.lisp      13 Dec 2006 21:33:43 -0000      1.65
+++ presentation-defs.lisp      5 Jan 2007 20:35:08 -0000
@@ -1470,10 +1470,15 @@ (define-presentation-method present ((ob
   ;; XXX: We can only visually represent the pathname if it has a name
   ;; - making it wild is a compromise. If the pathname is completely
   ;; blank, we leave it as-is, though.
-  (let ((pathname (if (equal object #.(make-pathname))
-                      object
-                      (merge-pathnames object (make-pathname :name
:wild)))))
-    (princ pathname stream)))
+
+  ;; AFAICT the above assertion is simply untrue.  At least it is
+  ;; possible to princ a directory with no :name component in ACL and
+  ;; SBCL.
+;;;  (let ((pathname (if (equal object #.(make-pathname))
+;;;                      object
+;;;                      (merge-pathnames object (make-pathname :name
:wild)))))
+    (princ object stream))
+;  )

 (define-presentation-method present ((object string) (type pathname)
                                      stream (view textual-view)



More information about the mcclim-devel mailing list