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


Jonathan left out the alternative that I thought most natural, namely
that otherwise undeclared
variables were not an error, but would default lexical. E.g.,

(setq x 3)

(defun frob () (incf x))

would not be an error, but would always refer to the lexically global x.

This would bring variable scoping in line with function scoping when
there were no declarations. (A state of grace.)

I presume that Kent didn't really mean to propose that the global
lexical environment be different from the global dynamic environment,
but that was just an awkward artifact of his sample implementation.
Right Kent?

The only idiom which might have portability problems are dynamic calls
to EVAL that get the dynamic binding, e.g., instead of using
SYMBOL-VALUE, e.g., user has a data base of permutations of variables &
values, and also of expressions, binds the variables with PROGV and then
evaluates the expressions.

While current practice is that compilers will warn about undeclared free
references, I know of no interpreter that does, do you?