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

greg greg at cosc.canterbury.ac.nz
Thu Nov 13 04:35:30 EST 2008


Steve Holden wrote:
> greg wrote:
> 
>>Do you agree that it makes sense to talk about assigning
>>that value to something?
>
> No. Why do you think that we are (mostly) careful to talk about binding
> names and values instead?

That's an odd position to take, considering that the
Python docs use the word "assignment" all over the
place, and the language even has a statement known
as an "assignment statement".

The Python Language Reference has this to say about
assignment:

  The following constructs bind names: formal parameters to functions, import
  statements, class and function definitions (these bind the class or function
  name in the defining block), and targets that are identifiers if occurring in
  an assignment...
  [http://docs.python.org/reference/executionmodel.html]

What this suggests to me is that the reason the
Language Ref talks about binding is not because there's
anything wrong with the word assignment, but because
binding is a more general term. Assignment is one way
to perform binding, but there are other things that
perform binding as well.

> But then various participants in this thread have
> demonstrated an apparently infinite capacity to split hairs with the
> presumed intention of proving themselves right and others wrong.

For my part, I'm not trying to "prove myself right",
I'm trying to be helpful by clearing up what seems to
me to be a misunderstanding about what the term
call-by-value implies. But it appears that some people
stubbornly refuse to have their misunderstandings
cleared up. :-)

That's how it looks from my end, anyway. No doubt from
the other end it looks like I'm the one being stubborn.
That's why I've been trying to inject some objectivity
by doing some research and finding authoritative
references to back up what I'm saying.

I'm learning things from all this, too. For example,
until recently I couldn't be sure I wasn't the only
person in the world who had thought of the idea of
defining call-by-value in terms of assignment rather
than copying. Turns out I'm not -- Backus et al, no
less, had exactly the same idea. And it seems they're
not the only ones, either -- more on that later.

-- 
Greg



More information about the Python-list mailing list