[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Non-yucky package names (I think)



New proposal:

Flush the rules for package-name caseification that are found in the
current package chapter.  Replace it with the following:

With respect to case, reading, and printing, package names are treated
EXACTLY like symbol names: upcase by default, escape that using / or ||,
observe *PRINT-CASE* on printing, look up using case-sensitive matching.

Note, however, that package names do not become symbols, but are
stashed away in the package object as a string, after case conversion
paralleling that for symbol-names.

So the reader reads a token in just as if it were a symbol.  If it hits
a : or #:, it doesn't call INTERN on the token just collected, but
instead calls FIND-PACKAGE.  Then it reads the following token, which
had better be a symbol, and interns it.

The various package functions that take package-name strings should
probably take symbol-or-string.  If a symbol, you get the
case-conversion for free but create a random symbol in the current
package; if a string, you have to be careful of case.

So, |fOo:BaR| would be a symbol containing a colon, but |fOo|:|BaR|
is symbol |BaR| in package |fOo|.  Notice that I have nothing up my
sleeves and at no time did my hands ever leave the keyboard.

What we lose is the cute preservation of original case in package names
and the ability to toss around package-name strings without worrying
about case.  What we gain is a lot of uniformity: both halves of a
symbol behave the same way.

-- Scott