(defun coerce-name (name) (typecase name (component (component-name name)) (symbol (string-downcase (symbol-name name))) (string name) (t (sysdef-error "~@<invalid component designator ~A~@:>" name))))
I first thought this was some bad kludge to support modern-mode. But vc-annotate told me that was introduced by Nikodemus.
What is the reason that symbols are downcased but strings not?
It makes
(FIND-SYSTEM :FOO)
be different from
(FIND-SYMBOL (SYMBOL-NAME :FOO))
which is just weird.
-T.
2009/11/21 Tobias C. Rittweiler tcr@freebits.de:
(defun coerce-name (name) (typecase name (component (component-name name)) (symbol (string-downcase (symbol-name name))) (string name) (t (sysdef-error "~@<invalid component designator ~A~@:>" name))))
I first thought this was some bad kludge to support modern-mode. But vc-annotate told me that was introduced by Nikodemus.
Digging a little deeper would have shown that I just normalized the whitespace there... :)
The original commit that introduces COERCE-NAME is 4a6a10eda91d50d929d6e95285dddc7b7cdc553c by Dan B, and contains the STRING-DOWNCASE in its current form -- but the comments on that commit do not shed any light on the why, unfortunately.
Cheers,
-- Nikodemus
Nikodemus Siivola wrote:
2009/11/21 Tobias C. Rittweiler tcr@freebits.de:
(defun coerce-name (name) (typecase name (component (component-name name)) (symbol (string-downcase (symbol-name name))) (string name) (t (sysdef-error "~@<invalid component designator ~A~@:>" name))))
I first thought this was some bad kludge to support modern-mode. But vc-annotate told me that was introduced by Nikodemus.
Digging a little deeper would have shown that I just normalized the whitespace there... :)
The original commit that introduces COERCE-NAME is 4a6a10eda91d50d929d6e95285dddc7b7cdc553c by Dan B, and contains the STRING-DOWNCASE in its current form -- but the comments on that commit do not shed any light on the why, unfortunately.
Given that it's Dan B, it's unlikely to have been to support Allegro mlisp, but it's a nice side-effect.
I'd be sorry to see this change.
The only thing I can think of about the non-downcased strings is that the assumption was that the strings are inconvenient enough that they are effectively a way of specifying an intention to override the default.
But that's just speculation. Could equally well be a simple oversight.
Best, r
2009/11/21 Robert Goldman rpgoldman@sift.info:
But that's just speculation. Could equally well be a simple oversight.
I've now had some coffee, so I'll speculate too:
I'm think downcasing was to make it convenient to have :case :local work, and not needing to name your system files FOO.asd. If system filename is going to be derived from the symbol name, then downcasing is an ugly but solid strategy to minimize portability issues (both when it comes to readtable case, modern mode, and case-sensitive vs insensitive filesystems.)
As for strings, I agree with your guess. Not case-folding strings allows for cased filenames if someone needs or wants them, and the read-syntax there is unambiguous: no sane Lisp is going to diddle the case of a string.
Cheers,
-- Nikodemus