Official definition of call-by-value (Re: Finding the instance reference...)
John Nagle
nagle at animats.com
Thu Nov 20 23:40:28 EST 2008
Steven D'Aprano wrote:
> On Thu, 20 Nov 2008 14:22:50 +1300, greg wrote:
>
>> Antoon Pardon wrote:
>>
>>> You are changing your argument. In a follow up you made the point that
>>> call by value should be as it was intended by the writers of the algol
>>> 60 report.
>> No, I was countering the argument that "call by value" is short for
>> "call by copying the value". I was pointing out that the inventors of
>> the term didn't use any such words.
>
> Nor did they define what assignment means, and their definition of
> "value" seems to exclude such things as strings.
>
>
>
>> Arguing that their words were intended to imply copying, as part of the
>> essence of the idea, is making an even bigger assumption about their
>> intentions, IMO.
>>
>> Rather it seems to me that the essence of the idea they had in mind is
>> that call-by-value is equivalent to assignment.
>
> You've just *assumed* that assignment in Algol 60 doesn't involving
> copying. Based on the very little I know about Algol, I think that is a
> very unsafe assumption. I know significantly more about Pascal, and in
> Pascal, assignment *is* copying.
>
> (I wait now with bated breath for somebody to point out some Python
> implementation or feature where assignment doesn't make a copy...)
In stock ALGOL-60, there are only the primitive types, and assignment
of them is a copy. Most useful implementations had strings, and Simula,
which was an ALGOL extension, had objects.
Simula had value parameters, reference parameter, and name parameters.
For assignment, ":=" specified a value assignment, and ":-" specified
a reference assignment.
John Nagle
More information about the Python-list
mailing list