Official definition of call-by-value (Re: Finding the instance reference...)

Joe Strout joe at strout.net
Sat Nov 22 15:40:19 CET 2008


On Nov 22, 2008, at 4:08 AM, Aaron Brady wrote:

> Furthermore, to apply c-b-v to Python, you have to
> introduce the concept of pointers, which is ostensibly non-native for
> human programmers.

Not necessarily "pointers" per se -- any type of object references  
will do, and yes, Python has those in spades.

>  You'd have a pretty hard time making the case that c-b-v is 'round  
> peg, round hole' for Python.

I didn't find it all that hard: <http://www.strout.net/info/coding/valref/ 
 >

>  Just describe it and give it a name.

OK: "Python variables contain object references, which are copied from  
the actual parameter expression to the formal parameter.  This  
evaluation strategy is named 'call-by-value,' though some authors use  
the term 'call-by-sharing' to indicate the specific case of call-by- 
value where the values passed are object references."

(I should add that last bit to my web page -- I'll try to do that this  
weekend.)

Cheers,
- Joe

P.S. I've pretty well tired of this thread, but I can't let Greg stand  
up for truth and clarity all by himself...




More information about the Python-list mailing list