Dennis Yelle
>>My understanding is that Algol 60 got call-by-name by accident.
>>The attempt to specify call-by-value was done so badly that it
>>actually specified call-by-name.
Sean Case says
>They were attempting to define call-by-reference, I believe, and were
>feeling quite pleased with themselves until Jensen's device turned up.
This simply represents the misunderstanding of Algol 60 by later
generations of computer "scientists" who were less educated in the
theoretic basis of programming languages. [I'm not blaming Dennis and Sean
- it's in the culture unfortunately]
Actually, my recollection is that Jensen's device was presented to me
around 1964 as a -desirable- feature of Algol 60. Which, efficiency apart,
it was, since for example you could use it to map arrays quite nicely. For
example the call:
sum(A[i],i,5,10,s)
to a procedure "sum" written something like this:
procedure sum(x,i,lo,hi,s);
begin
s := 0;
.... s := s+x; i:=1+1;
end;
would add up elements from a 1-dimensional array, BUT
sum(B[i,i],i,1,10,s)
would add up elements from the diagonal. This is NOT something you can do
with call-by-reference, tho' of course you can do it in the functional
paradigm by being explicit about the fact that the "x" parameter is a
function.
Call-by-reference came, I think, from Fortran.
Robin.
|