A question on modification of a list via a function invocation

Stephan Houben stephanh42 at gmail.com.invalid
Sun Sep 3 14:15:56 EDT 2017


Op 2017-08-17, Rustom Mody schreef <rustompmody at gmail.com>:
> On Thursday, August 17, 2017 at 6:49:19 AM UTC+5:30, Mok-Kong Shen wrote:
>> Am 17.08.2017 um 02:41 schrieb Steve D'Aprano:
>> > By reference and by value are not the only two conventions.
>> > 
>> > Perhaps if you go back to the 1950s you might be able to argue that
>> > "reference" and "value" are the only two conventions, but
>> > alternatives have existed for many decades, since *at least* 1960
>> > when Algol introduced "call by name".

I'm a bit late to this discussion, but pelase allow me to add some (to
me at least) fascinating history to this.

In 1966, a very influential paper was published:
P.J. Landin, "The Next 700 Programming Languages"
See: https://www.cs.cmu.edu/~crary/819-f09/Landin66.pdf

In this paper, Landin decribes a "family of unimplemented computing
languages that is intended to span differences of application area by a
unified framework". He calls this language (or family of languages)
ISWIM. It is a language with Lisp-like semantics but "Algol-like"
(i.e. infix) syntax, dynamically typed, and he introduces the novel
idea to have "Indentation, used to indicate program structure." 

Sounds familiar to anybody? Yep, this is basically proto-Python.

Anyway, then there is a later paper (from 1974) by
G.D. Plotkin, "Call-by-name, call-by-value and the λ-calculus"
(see http://www.sciencedirect.com/science/article/pii/0304397575900171 ).

In this paper, Plotkin "examines the old question of the relationship
between ISWIM and the λ-calculus, using the distinction between
call-by-value and call-by-name." Yep, in 1974, what to call the calling
convention of proto-Python was already an "old question".

In this paper, Plotkin introduces the λV-calculus, the call-by-value
lambda-calculus, to formalize what it is what ISWIM (and Python) are
actually doing. This paper is, to the best of my knowledge, the closest
thing to an "official" definition of what call-by-value actually means.

Needless to say, according to the definition in Plotkin's paper, Python
is "call-by-value".

Stephan



More information about the Python-list mailing list