Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Origin of term "reference" as in "pass-by-reference"

Java/C# language lawyers like to say that their language passes references by value. This would mean that a "reference" is an object-pointer which is copied when calling a function.

Meanwhile, in C++ (and also in a more dynamic form in Perl and PHP) a reference is an alias to some other name (or run-time value in the dynamic case).

I'm interested in the etymology here. What were early uses of the term "reference"? Lets go for pre-Java, but if you know of pre-C++ uses, that would also interest me.

(I'm aware that vocabulary changes, etc, but I'm just interested in the history).

like image 678
Paul Biggar Avatar asked Dec 06 '09 21:12

Paul Biggar


1 Answers

There is an early usage of the term "call by reference" in the paper "Semantic Models of Parameter Passing" by Richard E Fairley, March 1973.

In the early days, the terminology was inconsistent. For example, the Fortran 66 specification uses the phrases "association by name" and "association by value". We would now call these "call by reference" and "call by value". By contrast, Algol 60 specification (1962) used the terms "call by name" and "call by value" ... and neither of these are what we currently refer to as call by reference.

EDIT: To those who want to label the pioneers who specified Fortran 66 as confused for using the phrase "association by name", consider this:

  1. The Fortran 66 was the first attempt to specify a language with (what we now call) call by reference.

  2. It was only the second attempt to specify a language with subroutines that supported parameter passing.

  3. Fortran 66's "association by name" can be viewed as a restricted (degenerate) form of Algol 60's "call by name". The restriction being that in Fortran, the name had to be a simple variable or array name, where in Algol 60 it could be any expression.

  4. It was not clear at the time (1966) that Algol 60's "call by name" was destined to be abandoned as a bad idea. Indeed, when I studied Algol 60 as an undergraduate in 1977, I don't recall the lecturer presenting "call by name" as a bad idea. (It was presented as difficult to understand ... but that's a different thing.)

like image 61
Stephen C Avatar answered Oct 16 '22 17:10

Stephen C