It was devised by Danish computer scientist Jørn Jensen, who worked with Peter Naur at Regnecentralen.
[1][2][3] During his Turing Award speech, Naur mentions his work with Jensen on GIER ALGOL.
Call by name enables the procedure to change the value of the index variable during execution of the for loop.
Typically, ak will depend upon the changing (side-effected) k. For example, code to compute the sum of the first 100 terms of a real array V[] would be: During the execution of Sum, the actual argument i will increment during each step of the for loop, and each of the procedure's evaluations of ak will use the current value of i to access the successive array elements V[i].
[7] A slight variation would be suitable for initiating a numerical integration of an expression by a method very similar to that of Sum.
Another example is GPS (General Problem Solver), described in D. E. Knuth and J. N. Merner's ALGOL 60 confidential.
[9] Knuth says, "The use of 'macro' definition facilities to extend language, instead of relying solely on procedures for this purpose, results in a more satisfactory running program."
If on the other hand the procedure were to be coded the other way around (with b being saved to temp instead of a) then the desired action would result, unless it were invoked as swap(A[i],i).