libera/#ccl - IRC Chatlog
Search
17:17:01
pjb
yitzi: the problem is that the CL specification doesn't specify anything about physical pathname, specifies very little about logical pathnames, and cannot specify much at all for translations.
17:18:06
yitzi
Really? CLHS 19.3.1.1.7 says that logical pathname words are upper case but CCL permits mixed case and doesn't upcase them.
18:36:13
pjb
(setf (logical-pathname-translations "MYHOST") '()) (pathname-name #P"MYHOST:fooBar") #| --> "fooBar" |# is not conforming.
18:41:49
pjb
(setf (logical-pathname-translations "MYHOST") '(("**;*" "/tmp/**/*"))) (translate-logical-pathname #P"MYHOST:FOOBAR") #| --> #P"/tmp/FOOBAR" |#
18:42:26
yitzi
I know. I reread and I think it is a little gray in that area. The spec says that it doesn't have to upcase in translate-logical-pathname.
18:43:19
pjb
To get /tmp/foobar in a conforming way, you need to write: (setf (logical-pathname-translations "MYHOST") '(("FOOBAR" "/tmp/foobar") ("**;*" "/tmp/**/*"))) (translate-logical-pathname #P"MYHOST:FOOBAR") #| --> #P"/tmp/foobar" |#
18:44:13
pjb
yitzi: but there's a :case argument that can be :common or :local. The default is :local.
18:47:31
yitzi
SBCL: https://plaster.tymoon.eu/view/2574#2574 and CCL: https://plaster.tymoon.eu/view/2572#
19:03:47
pjb
Since you specified :case :local (by default) and since ccl consider that the local case is uppercase, and since you gave lower case name, I think your call is not conforming, and ccl can do whatever.
19:05:11
pjb
(make-pathname :host "FU" :name "WIBBLE" :type "QUUX" :case :common) #| --> #P"FU:wibble.quux" |#
19:05:11
pjb
(make-pathname :host "FU" :name "WIBBLE" :type "QUUX" :case :local) #| --> #P"FU:WIBBLE.QUUX" |#
19:05:11
pjb
(translate-logical-pathname (make-pathname :host "FU" :name "WIBBLE" :type "QUUX" :case :common)) #| --> #P"/bar/wibble.quux" |#
19:05:15
pjb
(translate-logical-pathname (make-pathname :host "FU" :name "WIBBLE" :type "QUUX" :case :local)) #| --> #P"/bar/WIBBLE.QUUX" |#
19:05:59
pjb
yitzi: when you call (pathname "FU:wibble.quux") #| --> #P"FU:wibble.quux" |# (which is done by #P"FU:wibble.quux").
19:06:14
pjb
So you see that's consistent with (translate-logical-pathname (make-pathname :host "FU" :name "WIBBLE" :type "QUUX" :case :common))
19:06:54
yitzi
Actually, I still think my example is fine. Logical pathnames can only have uppercase in name and type according to CLHS 19.3.1
19:07:06
pjb
(translate-logical-pathname (make-pathname :host "FU" :name "wibble" :type "quux" :case :local)) #| --> #P"/bar/wibble.quux" |#
19:07:36
pjb
Yes, it's an extension, where logical pathname can contain mixed case, to generate mixed case physical pathnames.
19:09:40
yitzi
But it the spec says translate-logical-pathname doesn't have to change the case. It does say the logical pathnames should be upcased though.
19:11:21
pjb
"translate-logical-pathname might perform additional translations, typically to provide translation of file types to local naming conventions, to accomodate physical file systems with limited length names, or to deal with special character requirements such as translating hyphens to underscores or uppercase letters to lowercase. Any such additional translations are implementation-defined. Some implementations do no additional
19:12:37
yitzi
But they also chose to do nothing in the constructor/parser for logical pathnames, which isn't permitted.
19:14:18
yitzi
I understand not respecting the spec in this case, just wish that there was a dynamic variable to make it follow the spec maybe.
19:15:11
pjb
One problem is that the CLHS doesn't specify what to do on specific platforms. We need substandards to specify that, when there are inconsistencies between implementations on the same platform.