Use parameter setter on working-directory-pathname.
authorChris Hanson <org/chris-hanson/cph>
Sun, 28 Feb 2016 03:23:04 +0000 (19:23 -0800)
committerChris Hanson <org/chris-hanson/cph>
Sun, 28 Feb 2016 03:23:04 +0000 (19:23 -0800)
src/runtime/wrkdir.scm

index 383ef6084bbd404f80e16e6e927341a06526e393..04151efe79445e5074a9787979bcf18de159963e 100644 (file)
@@ -28,9 +28,13 @@ USA.
 ;;; package: (runtime working-directory)
 
 (declare (usual-integrations))
-
+\f
 (define (initialize-package!)
-  (set! working-directory-pathname (make-parameter #f))
+  (set! working-directory-pathname
+       (make-general-parameter #f
+                               identity-procedure
+                               identity-procedure
+                               wd-setter))
   (reset!)
   (add-event-receiver! event:after-restore reset!))
 
@@ -45,6 +49,11 @@ USA.
 
 (define working-directory-pathname)
 
+(define (wd-setter set-param pathname)
+  (set-param pathname)
+  (param:default-pathname-defaults pathname)
+  pathname)
+
 (define (set-working-directory-pathname! name)
   (let ((pathname (new-pathname name)))
     ;; XXX Checking FILE-DIRECTORY? is a stop-gap kludge until we fix
@@ -62,7 +71,6 @@ USA.
                              'SET-WORKING-DIRECTORY-PATHNAME!
                              (list name)))
     (working-directory-pathname pathname)
-    (param:default-pathname-defaults pathname)
     (cmdl/set-default-directory (nearest-cmdl) pathname)
     pathname))