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

Re: Should ":" be an extended alphabetic character?

I'm willing to be convinced otherwise, but right now I'm in favor of
leaving ":" as an extended alphabetic character.  Maybe somebody should
explain to me how banning ":" would help.  Here's how I see it:

When porting Scheme code to Common Lisp (a thing few of us really want
to do), you can pretty much get away with replacing all occurrences of
":" by a character that's illegal in Scheme but a constituent in Common
Lisp, such as "[".

When porting Common Lisp code to Scheme, there are several problems
you can have with symbols and packages:

    1.  Symbols in the keyword package.  You can pretty much get by
        with making ":" into a non-terminating macro character so that
        :FOO turns into (QUOTE FOO).  My apologies for not having the
        customizable reader proposal out yet; you can do fairly well
        without a customizable reader by replacing all occurrences of
        " :" by " '".

    2.  Qualified symbols that are not in the USER package.  Since ":"
        is an extended alphabetic character in Scheme, you can just
        leave these alone.

    3.  Qualified symbols that are in the USER package.  Here you
        lose, unless the symbol is qualified wherever it appears.
        I would think, though, that even the Common Lisp community
        considers it poor style to intermix USER:FOO and FOO within
        the same file.

    4.  Unqualified symbols that are in the USER package.  You can
        leave these alone.

    5.  Unqualified symbols that are not in the USER package.  Here
        you lose big, but there's no way to avoid losing big without
        adding a package system to Scheme.  I know you can use
        environments to fake some things, but a silk purse is a
        poor substitute for the sow's ear.

The most severe problems come from unqualified symbols (5), so I don't
see how banning ":" from Scheme identifiers would help.  To the contrary,
banning ":" would definitely cause new problems with qualified symbols (2).

On the other hand, I've never converted any Common Lisp code that made
significant use of packages so I don't know what I'm talking about.

Peace, Will