[slime-devel] Re: SLIME and Lispworks?
Christophe Rhodes
csr21 at cam.ac.uk
Fri Nov 28 20:35:42 UTC 2003
Luke Gorrie <luke at bluetail.com> writes:
> Helmut Eller <e9626484 at stud3.tuwien.ac.at> writes:
>
>> Alain.Picard at memetrics.com writes:
>>
>> > Eerily enough, this is one of the first bugs I ever
>> > fixed in ILISP as well. I must be the only person using
>> > logical pathnames... :-)
>>
>> Fixed in CVS. Thanks!
>>
>> Are you a pathname expert? Is it better to use
>> translate-logical-pathname or truename?
>
> Christophe Rhodes said that we should use translate-logical-pathname
> (in the SBCL backend).
"pathname expert". Don't make me laugh. (Don't make me start
ranting, either).
There are two separate operations that one can do on CL pathnames in
this context; conveniently, we can denote this by some kind of
flowchart:
TRANSLATE-LOGICAL-PATHNAME TRUENAME
/----------\ /----------\ /------------\
| "Logical"|----/ | physical |----/ | "canonical"|
| pathname | /----->| pathname | /----->| pathname |
\----------/ \----------/ \------------/
| ^
\------------------------------------------/
TRUENAME
The bad thing about passing a logical pathname to emacs, as you've
observed, is that it doesn't go down too well; generally, there isn't
a file called SYS:SRC;CODE;FD-STREAMS.LISP anywhere lying around, and
even if there is it's not usually the one you're looking for. So we
need to do at least TRANSLATE-LOGICAL-PATHNAME.
As for TRUENAME, well, it might seem that getting some kind of
canonical pathname out might be a good thing. Sadly, though, what
"canonical" means is by no means clear. Some implementations treat
that as resolving symlinks (but not hardlinks); some implementations
don't; some implementations (ACL, in the patch series for 6.2)
oscillate between the two. More importantly perhaps, TRUENAME will
throw an error if it thinks that no such file exists on the
filesystem, so at the very least your protocol needs to handle this.
TRANSLATE-LOGICAL-PATHNAME should never throw an error if handed a
string or pathname; if it finds no suitable logical host to translate
from, it simply leaves the pathname alone.
I hope that clarifies things somewhat :-)
Cheers,
Christophe
PS: yeah, use T-L-P and let emacs do the rest. That's my advice.
--
http://www-jcsu.jesus.cam.ac.uk/~csr21/ +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%") (pprint #36rJesusCollegeCambridge)
More information about the slime-devel
mailing list