Reference or Value?

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Tue Feb 24 05:47:59 CET 2009


On Mon, 23 Feb 2009 08:14:34 -0300, andrew cooke wrote:

> Steven D'Aprano wrote:
>> On Sun, 22 Feb 2009 13:37:27 -0300, andrew cooke wrote:
>>
>>> as far as i understand things, the best model is:
>>>
>>> 1 - everything is an object
>>> 2 - everything is passed by reference
>>
>> Except that is wrong. If it were true, you could do this:
> [pointer swapping]
> 
> i was thinking of how the stack is used; i would have called what you
> are talking about "pointer semantics".  however, on reading around a
> little, it seems that i'm in a very small minority (which is a pity,
> because if you restrict the meaning to how values are handled on the
> stack then you get a lot closer to having just values and references,
> rather than the whole pile of different terms that are apparently in
> use).
> 
> sorry for the confusion,

Why is it a pity to have a whole pile of different terms to describe a 
whole lot of different behaviours? I would suggest the real confusion 
would be if we had two terms to describe a dozen different parameter-
passing conventions.




-- 
Steven



More information about the Python-list mailing list