[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Poor excuse for packages
Date: Friday, 17 May 1985, 10:32-EDT
From: Guy Steele <gls%AQUINAS@THINK.ARPA>
KMP hinted at a very interesting solution to the special-variables
problem: let symbols in the package SPECIAL name special variables,
and let all others name local variables. There doesn't seem to be
much wrong with
(LET ((SPECIAL:MY-GLOBAL-FLAG 43)
(SPECIAL:PRINT-PRETTY T))
...)
or
(DEFUN FOO (A B SPECIAL:C) ...)
Ack! What's the point of packages then? I thought they were for
avoiding name conflicts. Maybe you meant that some packages should be
declared as holding only special symbols. Then we could have
MY-SPECIAL:FOO and YOUR-SPECIAL:FOO. But this is getting silly.
I think a more interesting interpretation of KMP's idea is to have some
symbols which are always special. How they are marked internally is an
implementation detail. The problem from the language designer's point
of view is then to decide how the programmer specifies which of the
symbols he typed are special and which are not. Other places in the
language, we have used syntactic markers -- why not here? (YOW! Are we
Common SCHEME yet??)
The only similar thing in the present CL is the ":" vs. "::" syntax for
internal and external package symbols. So we probably want some sort of
prefix operator. Perhaps "*" as a leading character, since that would
break the smallest number of existing programs. Maybe *:FOO and
MY-PACKAGE*:FOO. Hopefully someone an come up with a better syntax.
It's cheap to detect, too, in interpreter or compiler: just check the
package cell. This I like. Too bad it's too late.
An ugly suggestion is to ADD this mechanism to the language without
removing the declaration syntax yet, and let people phase over during
the next year. Ugh, bletch.