1.0.44.21: expand ~ in pathnames
~/... => (:ABSOLUTE :HOME ...)
~user/... => (:ABSOLUTE (:HOME "user") ...)
Translation back to NAMESTRING reinstates the tilde, so we retain
read/write consistency.
NATIVE-NAMESTRING is responsible for getting the actual full path
to specified home directory.
This late resolution is necessary to have (open "~/foo") and
(open #p"~/foo") open the same file in compiled code -- regardless
of who compiled the file.
Tilde is treated specially only at the start of the first directory
component: it doesn't need to be escaped anywhere else. After trying
out the various options (escape everywhere, escape in directory
components, escape at the start of directory components, escape at
the start of all components) this seemed both least intrusive and
least ambiguous when documented -- not to mention most backwards
compatible.
Currently escaping the tilde does not work on Windows, but this is due to
current general inability to escape the first directory component on
Windows, since \\ is used also as a directory separator for non-native
pathnames as well. See lp#673625. Test-case added for this.
(:HOME "user") also doesn't work on Windows, which is documented
in the manual.
12 files changed: