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

Another omission: global lexicals

    Date: Mon, 16 Dec 85 13:14 EST
    From: Guy Steele <gls@THINK-AQUINAS.ARPA>

    (defvar foo 3)
    (defun baz () foo)
    (baz) => 3
    (defglobal foo 5)
    (baz) => 5

    the DEFGLOBAL changes the meaning of the variable reference in BAZ.

In the only semantics that currently seems to make sense to me, the
DEFGLOBAL does not change the meaning.  Since FOO is still declared
special, the FOO in the body of BAZ is still a special reference.

Unless you are assuming that DEFGLOBAL does a sort of (PROCLAIM (UNSPECIAL)),
which I am not.

    Right now the meaning of FOO within BAZ can be determined by inspection
    of only BAZ:  because there is no *lexically apparent* lexical binding,
    the reference to FOO must be special.  With DEFGLOBAL as proposed, the
    meaning of FOO cannot be understood out of context.

I'm not sure I concur with this logic.  The meaning of FOO within BAZ
depends on non-lexically-local information, namely whether FOO has been
proclaimed special.  In present CL as I know it, FOO is either a special
reference or an error depending on whether FOO is proclaimed special; in
the new proposal, semantics as I am assuming, FOO is either a special
reference or a local reference or an error, depending on whether FOO is
proclaimed special and on whether FOO is part of the global lexical
environment or not.  So the DEFGLOBAL is just another thing like a
special proclaimation.

Again, I'm not trying to support anything or object to anything, just
trying to nail down what it is that the proposal means.