Is the X in (LET ((x ...) a fully fleshed symbol?

Viewed 69

Or in other words: Is it possible for a variable in CL not to be (part of) a symbol?

I think I may have a profound misconception about variables in CL.

I always thought CL has no variables, only symbols, and symbols have (among other properties) a name and a value cell (which is the variable).
And when someone said "variable x has the value 42" I thought it was short for "the value cell of the symbol named x stores the value 42".

But this is probably wrong.

When I type

> (let ((a 42))
       (type-of 'a))
SYMBOL
; caught STYLE-WARNING:
;   The variable A is defined but never used.

is the lexical variable a in this example a fully fleshed symbol whose value cell has been set to 42?

Because the warning The variable A is defined but never used suggests otherwise and it appears that the lexical variable is not the same thing as the symbol a in the following form (type-of 'a).

3 Answers
Related