Official definition of call-by-value (Re: Finding the instance reference...)
castironpi at gmail.com
Tue Nov 18 10:16:28 CET 2008
On Nov 18, 2:21 am, Antoon Pardon <apar... at forel.vub.ac.be> wrote:
> On 2008-11-12, greg <g... at cosc.canterbury.ac.nz> wrote:
> > Here is the definition of call-by-value from the
> > "Revised Report on the Algorithmic Language Algol 60"
> > 184.108.40.206. Value assignment (call by value). All formal parameters quoted in the
> > value part of the procedure declaration heading are assigned the values (cf.
> > section 2.8. Values and types) of the corresponding actual parameters, these
> > assignments being considers as being performed explicitly before entering the
> > procedure body. The effect is as though an additional block embracing the
> > procedure body were created in which these assignments were made to variables
> > local to this fictitious block with types as given in the corresponding
> > specifications (cf. section 5.4.5).
> > There you have it -- call by value is offially defined in
> > terms of assignment. There is no mention in there of copying.
> Call by value is officially defined in terms of assignment in
> a context where assignments means copying and in a definition
> of a specifix language.
> You can't lift this part out of the definition of algol 60
> and say it applies equally well in languages with different
> assignment semantics.
> If call by value is defined in terms of assignment regardless
> of what the semantics of the assignment is then IMO call by
> value is rather useless term and it would be better to talk
> about call by copy in the case of C, to make sure one understands
> the difference between what happens in C and what happens in
> other languages that also have "call by assignment" but behave
> very differently.
> Antoon Pardon
I think Joe's argument was, C and Python can both be call-by-value, so
long as Python variables are construed to be pointers. To him,
pointers are easy to understand, even for novices, and the copy
constructor for pointers is trivial.
Otherwise, C and Algol have different definitions of call-by-value,
and while Java might be Algol-call-by-value, Python is not C call-by-
value. So, between C and Algol has majority and which has seniority
claim to the term?
More information about the Python-list