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

Fredrik Lundh fredrik at pythonware.com
Thu Nov 13 08:24:25 EST 2008


greg wrote:

> If you're going to indulge in argument by authority,
> you need to pick authorities that can be considered,
> er, authoritative in the field concerned...

Like Barbara Liskov, who's won tons of awards for her work on computer 
science and programming languages, and who was among the first to 
design, implement, and formally describe a language with *exactly* the 
same evaluation semantics as Python?  What did she and her co-authors 
have to say about the calling semantics in their new language?  Let's see:

     "In particular it is not call by value because mutations
     of arguments performed by the called routine will be
     visible to the caller.  And it is not call by reference
     because access is not given to the variables of the
     caller, but merely to certain objects."

Let's take that again, with emphasis:

     "IN PARTICULAR IT IS NOT CALL BY VALUE because mutations
     of arguments performed by the called routine will be visible to
     the caller. And IT IS NOT CALL BY REFERENCE because access
     is not given to the variables of the caller, but merely to
     certain objects."

"It is not".  "And it is not".

But maybe they were just ignorant, and didn't really "get" how earlier 
languages worked?  Let's see what Liskov has to say about that:

     "The group as a whole was quite knowledgeable about languages that
     existed at the time. I had used Lisp extensively and had also
     programmed in Fortran and Algol 60, Steve Zilles and Craig
     Schaffert had worked on PL/I compilers, and Alan Snyder had done
     extensive programming in C. In addition, we were familiar with
     Algol 68, EL/1, Simula 67, Pascal, SETL, and various machine
     languages. Early in the design process we did a study of other
     languages to see whether we should use one of them as a basis for
     our work [Aiello, 1974]. We ultimately decided that none would be
     suitable as a basis. None of them supported data abstraction, and
     we wanted to see where that idea would lead us without having to
     worry about how it might interact with pre-existing
     features. However, we did borrow from existing languages.  Our
     semantic model is largely borrowed from Lisp; our syntax is
     Algol-like."

Still think they didn't understand Algol's semantic model?

:::

But nevermind - the real WTF with threads like this one is the whole 
idea that there are two and only two evaluation strategies to choose 
from.  That's a remarkable narrow-mindedness.

</F>




More information about the Python-list mailing list