(define (uri->pathname uri #!optional error?)
(let ((uri (->uri uri (and error? 'URI->PATHNAME)))
- (defaults (*default-pathname-defaults*))
+ (defaults (get-default-pathname-defaults))
(finish
(lambda (device path keyword)
(receive (directory name type)
(pathname-host
(if (and (not (default-object? defaults)) defaults)
defaults
- (*default-pathname-defaults*))))))
+ (get-default-pathname-defaults))))))
(cond ((string? namestring)
((host-type/operation/parse-namestring (host/type host))
namestring host))
(let ((defaults
(if (and (not (default-object? defaults)) defaults)
(->pathname defaults)
- (*default-pathname-defaults*))))
+ (get-default-pathname-defaults))))
(let ((pathname (enough-pathname pathname defaults)))
(let ((namestring (pathname->namestring pathname)))
(if (host=? (%pathname-host pathname) (%pathname-host defaults))
;;;; Pathname Merging
(define *default-pathname-defaults*)
+(define default-pathname-defaults)
+
+;;; Kludge to support FLUID-LET:
+(define (get-default-pathname-defaults)
+ (if (default-object? *default-pathname-defaults*)
+ (default-pathname-defaults)
+ *default-pathname-defaults*))
(define (merge-pathnames pathname #!optional defaults default-version)
(let* ((defaults
(if (and (not (default-object? defaults)) defaults)
(->pathname defaults)
- (*default-pathname-defaults*)))
+ (get-default-pathname-defaults)))
(pathname (pathname-arg pathname defaults 'MERGE-PATHNAMES)))
(make-pathname
(or (%pathname-host pathname) (%pathname-host defaults))
(let* ((defaults
(if (and (not (default-object? defaults)) defaults)
(->pathname defaults)
- (*default-pathname-defaults*)))
+ (get-default-pathname-defaults)))
(pathname (pathname-arg pathname defaults 'ENOUGH-PATHNAME)))
(let ((usual
(lambda (component default)
(vector-set! types index (make-unimplemented-host-type index))))
(set! host-types types)
(set! local-host (make-host host-type #f))))
- (set! *default-pathname-defaults*
+ (set! *default-pathname-defaults* #!default)
+ (set! default-pathname-defaults
(make-parameter (make-pathname local-host #f #f #f #f #f)))
(set! library-directory-path
(make-parameter
(cons standard-error-hook #f)
(cons standard-warning-hook #f)
(cons standard-breakpoint-hook #f)
- (cons *default-pathname-defaults*
- (*default-pathname-defaults*))
+ (cons default-pathname-defaults (default-pathname-defaults))
(cons dynamic-handler-frames '())
(cons *bound-restarts*
(if (cmdl/parent cmdl) (*bound-restarts*) '())))
(pathname-as-directory
((ucode-primitive working-directory-pathname))))))
(*working-directory-pathname* pathname)
- (*default-pathname-defaults* pathname))
+ (default-pathname-defaults pathname))
unspecific)
(define *working-directory-pathname* (make-parameter #f))
'SET-WORKING-DIRECTORY-PATHNAME!
(list name)))
(*working-directory-pathname* pathname)
- (*default-pathname-defaults* pathname)
+ (default-pathname-defaults pathname)
(cmdl/set-default-directory (nearest-cmdl) pathname)
pathname))
(define (with-working-directory-pathname name thunk)
(let ((pathname (new-pathname name)))
- (parameterize* (list (cons *default-pathname-defaults* pathname)
+ (parameterize* (list (cons default-pathname-defaults pathname)
(cons *working-directory-pathname* pathname))
thunk)))