Nested function scope problem

Antoon Pardon apardon at forel.vub.ac.be
Sat Jul 29 12:54:29 EDT 2006


On 2006-07-29, Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
> On 28 Jul 2006 18:20:52 GMT, Antoon Pardon <apardon at forel.vub.ac.be>
> declaimed the following in comp.lang.python:
>
>
>> That is not true. It may be the case in a number of languages but
>> my experience with lisp and smalltalk, though rather limited,
>> says that no such memory location is implied with the word "variable"
>> in those languages and AFAIK they don't have a problem with the
>> word "variable" either.
>>
> 	I have no smalltalk experience, and my lisp goes back to a cassette
> based version on a TRS-80 Model III...
>
> 	Since, at that time at least, everything in lisp was a
> tree-branching linked list I had trouble even considering setq to define
> a "variable" -- it was closer to adding a name to a node of the lists...
><G> {Yes, that IS a very loose interpretation}
>
> 	Does lisp permit one object to have multiple "variables" attached to
> it -- that is, two or more names on one "object" (whatever the node
> contains)...

AFAIK, yes

> And if so, what happens if, say, the "object" had been a
> scalar value "3.14159265436" perhaps and you make an "assignment" to one
> of the names?

About the same as happens in Python. One name will then be attached to
a new "value" and the other names will still be attached to "3.14159265436"

-- 
Antoon Pardon



More information about the Python-list mailing list