From: Chris Hanson Date: Fri, 26 Nov 2004 05:04:42 +0000 (+0000) Subject: Implement GUARANTEE-PATHNAME and ERROR:NOT-PATHNAME. X-Git-Tag: 20090517-FFI~1431 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=908814706c66ad87094fe64b7870adfc91352425;p=mit-scheme.git Implement GUARANTEE-PATHNAME and ERROR:NOT-PATHNAME. --- diff --git a/v7/src/runtime/pathnm.scm b/v7/src/runtime/pathnm.scm index 2e8f82824..0239d1ac6 100644 --- a/v7/src/runtime/pathnm.scm +++ b/v7/src/runtime/pathnm.scm @@ -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: (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)) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index 10dd64ae3..8f0db7af1 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -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=?