Values and objects

Marko Rauhamaa marko at pacujo.net
Sun May 11 11:46:51 EDT 2014


Jussi Piitulainen <jpiitula at ling.helsinki.fi>:

> The claim was that Lisp variables are symbols. What do you write in
> Common Lisp in place of the "..." to have the following evaluate to
> the the value of the variable x?
>
>     (let ((x (f)) (y 'x)) (... y ...))
>
> No, (eval y) is not an answer, and (symbol-value y) is not an answer:
> these do not do the thing at all.

I must admit I have never used Common Lisp. I can only guess from your
question its symbol-value fetches the value from the global symbol table
-- even if you replaced let with let* (the two x's are not the same
symbol when let is used).

I don't see any practical reason for that limitation. If you allow
setq/setf/set!, you have no reason to disallow symbol-value on a local
variable.


Marko



More information about the Python-list mailing list