Nested function scope problem

Antoon Pardon apardon at forel.vub.ac.be
Thu Jul 27 14:18:13 EDT 2006


On 2006-07-27, Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
> On 27 Jul 2006 14:11:35 GMT, Antoon Pardon <apardon at forel.vub.ac.be>
> declaimed the following in comp.lang.python:
>
>> In a language like C the name doesn't hold anything either. 
>> The name is just a way for refering to a memory space which
>> will hold something.
>>
> 	Except for one difference... In C (and most other languages) that
> memory space is FIXED -- name "X" ALWAYS refers to memory space "Y".
> Even in the case of a C pointer -- "P" always refers to one memory space
> "p" wherein the contents of that memory space is a user-accessible
> reference to some other memory space; to actually get to the object one
> must dereference "P" using "*P" or "P->" type notation
>
> 	In Python, even the location of the "name" may vary -- if you "del
> name" then do some operations and rebind "name", the new "name" itself
> could be somewhere else in memory.

You are right. That is a difference between Python and C. But How
important is that difference? Should I design a C-like language
with the parror virtual machine in mind as target architecture:

  http://www.parrotcode.org/

Would that difference be important enough to no longer talk about
variables? IMO we also talk about Lisp- and Smalltalk variables
and AFAIK these behave more like Python than C. If "variables"
is used in such languages, why should the term not be appropiate
for Python.

-- 
Antoon Pardon



More information about the Python-list mailing list