Implement GUARANTEE-PATHNAME and ERROR:NOT-PATHNAME.
authorChris Hanson <org/chris-hanson/cph>
Fri, 26 Nov 2004 05:04:42 +0000 (05:04 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 26 Nov 2004 05:04:42 +0000 (05:04 +0000)
v7/src/runtime/pathnm.scm
v7/src/runtime/runtime.pkg

index 2e8f82824cba666f35fb26a3d9aab6cd582c2067..0239d1ac6fd6396b45f3152956d70a2ab6332859 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: pathnm.scm,v 14.41 2004/11/26 04:47:24 cph Exp $
+$Id: pathnm.scm,v 14.42 2004/11/26 05:04:27 cph Exp $
 
 Copyright 1987,1988,1989,1990,1991,1992 Massachusetts Institute of Technology
 Copyright 1993,1994,1995,1996,2000,2001 Massachusetts Institute of Technology
@@ -100,8 +100,7 @@ these rules:
 \f
 (define-structure (pathname
                   (type vector)
-                  (named ((ucode-primitive string->symbol)
-                          "#[(runtime pathname)pathname]"))
+                  (named '|#[(runtime pathname)pathname]|)
                   (constructor %make-pathname)
                   (conc-name %pathname-)
                   (print-procedure
@@ -116,6 +115,13 @@ these rules:
   (type #f read-only #t)
   (version #f read-only #t))
 
+(define (guarantee-pathname object caller)
+  (if (not (pathname? object))
+      (error:not-pathname object caller)))
+
+(define (error:not-pathname object caller)
+  (error:wrong-type-argument object "pathname" caller))
+
 (define (->pathname object)
   (pathname-arg object #f '->PATHNAME))
 
index 10dd64ae32047b5dacaf8d40fd2043f89a82326e..8f0db7af1a4d37a5f3a7dda347e4b7db8f7e9429 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: runtime.pkg,v 14.520 2004/11/26 04:47:35 cph Exp $
+$Id: runtime.pkg,v 14.521 2004/11/26 05:04:42 cph Exp $
 
 Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology
 Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology
@@ -2491,8 +2491,10 @@ USA.
          directory-pathname?
          enough-namestring
          enough-pathname
+         error:not-pathname
          file-namestring
          file-pathname
+         guarantee-pathname
          host-namestring
          host/type-name
          host=?