]> birchwood-abbey.net Git - mit-scheme.git/commit
ref-manual: Undeprecate with-working-directory-pathname.
authorTaylor R Campbell <campbell+mit-scheme@mumble.net>
Wed, 3 Feb 2021 15:55:26 +0000 (15:55 +0000)
committerTaylor R Campbell <campbell+mit-scheme@mumble.net>
Wed, 3 Feb 2021 16:04:27 +0000 (16:04 +0000)
commitf8671e8b08213716478531c44133292ea2826187
treeddfd16fe5caa30ed3cfe0ec03f784e3da5b74cce
parentaced184228e5174262834a4e709f01a4a6ab4185
ref-manual: Undeprecate with-working-directory-pathname.

The mechanism of working-directory-pathname as a parameter doesn't
work very well -- it leaves bogus pathnames around in bands, and it
doesn't really match the OS semantics anyway.

If we simply try to use a parameter getter,

   (define (wd-getter pathname)
     (or pathname
         (pathname-simplify
          ... (ucode-primitive working-directory-pathname) ...))

   (define working-directory-pathname
     (make-general-parameter ... wd-getter ...))

then when the REPL tries to preserve the working directory pathname with

   (parameterize ((working-directory-pathname (working-directory-pathname)))
     ...)

it has the side effect of keeping the pathname persistently in bands
again.  I tried to find a way around, but really the mechanism of
storing a pathname in userland memory is just not a good way to
reflect the working directory state; should really use directory file
descriptors and fchdir or openat &c.

Some further details:
https://lists.gnu.org/archive/html/bug-mit-scheme/2020-08/msg00002.html

(cherry picked from commit d102b20a4634882ee3e1c2be300f77b2ca507655)
doc/ref-manual/os-interface.texi