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

Aaron Brady castironpi at gmail.com
Sat Nov 22 20:28:57 EST 2008


On Nov 22, 8:40 am, Joe Strout <j... at strout.net> wrote:
> 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.

Humans don't.  That's my point.

> >  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/

A cut and paste into my editor counts 2,563 words on your link.  Does
2,563 words classify as 'round peg, round hole' in your world?

> >  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."

Better: Objects are passed to functions without copying, and
assignment assigns a new identity to the variable, without changing
the old object.  Round peg, round hole.

The only purpose it serves to keep bringing up reference this and
reference that, is so you can 'square peg, round hole' the term 'call-
by-value'.

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

What you should do, is add mine to the 'short answer' section, and
yours to the 'long answer' section.  Diversify your portfolio.

> 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...

Truth and clarity are not tired of this thread.



More information about the Python-list mailing list