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

The (not special) declaration

Really this should be there, on grounds of completeness if nothing else.
(1) CommonLisp claims to be primarily lexically scoped, but there is no
    way to declare the type of a variable such that it is lexically scoped;
    (it is unusual to find a construct with a default behaviour which you
    cannot explicitly state);
(2) espcially I cannot hide the effect of a PROCLAIM SPECIAL anywhere,
    because of the lack of a (NOT SPECIAL) type;
(3) which is serious, because the 'obvious' way to declare a global is to
    use DEFVAR, which uses PROCLAIM SPECIAL.  Why is the 'normal' global
    variable construct in a lexically scoped lisp proclaimed special?
    (You can of course get a lexical global effectively by using a top-level
    SETQ, and then declaring special in just those forms where you want
    to access the global.  But setq is not really a 'declaration', and it is
    at least odd to find a lexical-scope language with no lexical-global

Personally I like the suggestion to include a LOCAL specifier; (I also like
the suggestion to be allowed to declare types where most other languages
do, i.e. with first mention, like in defun argument lists
(defun fred (integer foo) ...);  I have been bitten by the current rules,
and the new ones are an improvement but nowhere near as automatically
intuitive as say algol.  Yes, I think it was a mistake to mix lexical
and special variables in the same language constructs).