Re: Pathname representations Lassi Kortela 07 Feb 2020 22:50 UTC

> It's important to define exactly what CWD means.  I can think of several
> different definitions:
>
>  1. what (current-working-directory) and the like return
>  2. the directory in which "foo" will be sought in (open-input-file "foo")
>  3. the initial OS-level working directory of a newly created
>     subprocess, regardless of the language the process is running
>
> All of these can be controlled the same way, but that's not strictly
> necessary.
>
> My inclination is that all three should be controlled by a thread-local
> parameter.

I agree. It would likely make it harder to reason about programs if the
three things are different, and hard to remember the details of the
differences. To me at least, it would seem the kind of gratuitous
abstraction leak that I go to Lisp/Scheme in order to avoid :)

This would imply that the subprocess spawn procedure sets the CWD of the
new subprocess to whatever the thread-local Scheme-level CWD was in the
thread that spawned it.