Call by name
The formal is reevaluated at each use
Uses a thunk to implement it
swap(i, a[i])
i = 1
a[1] = 3
a[3] = 17
Doesn’t swap, and you can’t fix it
proc swap(a, b : int);
var temp : int;
begin
temp := a;
a := b;
b := temp
end;
Previous slide
Next slide
Back to first slide
View graphic version