Robert Goldman rpgoldman@sift.info writes:
On 5/22/11 May 22 -5:36 PM, Pascal J. Bourguignon wrote:
Robert Goldman rpgoldman@sift.info writes:
FWIW, I am just working on a project that has some CL people and some non-CL people. The fact that pathnames with underscores (that C programmers, e.g., are fond of) break decoding when they appear in logical pathnames is a real stinker.
This alone is almost enough to rule out of court the use of logical pathnames, IMO....
Logical pathnames are not made to represent physical pathnames. For this, there are physical pathnames.
However, you can map logical pathnames to physical pathnames, with logical pathname translations.
But obviously, pathnames provided by users won't be logical pathnames: logical pathnames are meaningless to users. Users only know physical pathnames. Logical pathnames are not designed to be used by user, but by programmers, to shield programmers from the idiosyncrasies of user pathnames.
OK, but how does forbidding the use of underscores shield anyone from anything except access to files! ;-)
It does not.
CL-USER> (setf (logical-pathname-translations "USERFILES") nil (logical-pathname-translations "USERFILES") (list (list #P"USERFILES:MY-APP.CONFIG" #P"/home/pjb/my_app.config")))
((#P"USERFILES:MY-APP.CONFIG" #P"/home/pjb/my_app.config")) CL-USER> (with-open-file (conf #P"USERFILES:MY-APP.CONFIG") (read conf)) ((CONFIG FROM "my_app.config") :DATA (TEST DATA)) CL-USER>
Logical pathnames are made to be used as literal in program sources. There's absolutely no problem in respecting the logical pathname syntax there, since those are purely symbolic names.
With all due respect, people WANT filenames with underscores in them.
Of course. People MUST use physical pathnames.
And if I specify a logical host, and provide code that uses that logical host to access real physical files, then users are going to be confused when they can open
"foo:bar;baz.lisp"
but
"foo:bar;baz_2.lisp"
will stubbornly refuse to load....
There's no reason users should be expected to user logical pathnames. Logical pathnames are not made for users, but for programmers, to be included in program sources.
Worse, if I write code that loads files for users, they will just see
(process-my-file "baz_2.lisp")
fail to work....
There's no reason it should fail, since it cannot be parsed as a logical pathname, it will be parsed as a physical pathname and everything will work as expected.
But then, ASDF is not used by users, but by programmers. Therefore there's no incompatibility between ASDF and logical pathnames.
Right. As Faré points out, he has made every effort to make ASDF work with logical pathnames. But that is different from the claim some seem to be making, that logical pathnames are /sufficient/ for ASDF. I am with Faré in feeling that this is not so....
Well, I didn't have any difficulty using logical pathnames with ASDF.
Notably, for a time I had installed a function to map system names such as
:com.informatimago.common-lisp.abc.xyz
to logical pathnames:
#P"PACKAGES:COM;INFORMATIMAGO;COMMON-LISP;ABC;XYZ;SYSTEM.ASD"
and it worked well. Those logical pathnames were translated to physical pathnames such as;
#P/some/path/com/informatimago/common-lisp/abc/xyz/system.asd"
Nowadays, I use quicklisp as a blackbox.