From 89e3780e53992b416998d54522bed51ae8bd2ff2 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 27 Feb 2016 13:32:17 -0800 Subject: [PATCH] Eliminate *working-directory-pathname*. --- src/runtime/rep.scm | 4 ++-- src/runtime/runtime.pkg | 2 -- src/runtime/wrkdir.scm | 14 ++++++-------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/runtime/rep.scm b/src/runtime/rep.scm index a7eebe301..fc9a2a5ec 100644 --- a/src/runtime/rep.scm +++ b/src/runtime/rep.scm @@ -122,8 +122,8 @@ USA. (cons *notification-output-port* #f) (cons *trace-output-port* #f) (cons *interaction-i/o-port* #f) - (cons *working-directory-pathname* - (*working-directory-pathname*)) + (cons working-directory-pathname + (working-directory-pathname)) (cons *nearest-cmdl* cmdl) (cons standard-error-hook #f) (cons standard-warning-hook #f) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 431bf3539..2a6de979e 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -5025,8 +5025,6 @@ USA. set-working-directory-pathname! with-working-directory-pathname working-directory-pathname) - (export (runtime rep) - *working-directory-pathname*) (initialization (initialize-package!))) (define-package (runtime user-interface) diff --git a/src/runtime/wrkdir.scm b/src/runtime/wrkdir.scm index 1871d2acf..ba5dae21b 100644 --- a/src/runtime/wrkdir.scm +++ b/src/runtime/wrkdir.scm @@ -30,6 +30,7 @@ USA. (declare (usual-integrations)) (define (initialize-package!) + (set! working-directory-pathname (make-parameter #f)) (reset!) (add-event-receiver! event:after-restore reset!)) @@ -38,14 +39,11 @@ USA. (pathname-simplify (pathname-as-directory ((ucode-primitive working-directory-pathname)))))) - (*working-directory-pathname* pathname) + (working-directory-pathname pathname) (default-pathname-defaults pathname)) unspecific) -(define *working-directory-pathname* (make-parameter #f)) - -(define (working-directory-pathname) - (*working-directory-pathname*)) +(define working-directory-pathname) (define (set-working-directory-pathname! name) (let ((pathname (new-pathname name))) @@ -63,7 +61,7 @@ USA. "no such directory") 'SET-WORKING-DIRECTORY-PATHNAME! (list name))) - (*working-directory-pathname* pathname) + (working-directory-pathname pathname) (default-pathname-defaults pathname) (cmdl/set-default-directory (nearest-cmdl) pathname) pathname)) @@ -71,10 +69,10 @@ USA. (define (with-working-directory-pathname name thunk) (let ((pathname (new-pathname name))) (parameterize* (list (cons default-pathname-defaults pathname) - (cons *working-directory-pathname* pathname)) + (cons working-directory-pathname pathname)) thunk))) (define (new-pathname name) (pathname-simplify (pathname-as-directory - (merge-pathnames name (*working-directory-pathname*))))) \ No newline at end of file + (merge-pathnames name (working-directory-pathname))))) \ No newline at end of file -- 2.25.1