As I understand it, call-by-name means the following:

Suppose for example if you coded a subroutine that expected some sort of 
parameter, and called it with a random number function, the random number 
function would (in most languages) get evaluated once before your subroutine 
was called, and your subroutine would see it as a constant. If you printed it 
three times in a loop it would be the same all three times.

With call-by-name, 'RAND()' (or whatever) would not get evaluated by the caller 
but rather passed to your subroutine "as-is." It would get evaluated whenever 
your subroutine referenced it. If you printed it three times in a loop you 
would get three different values.

It's not really "call by name" but rather "call with function" as opposed to 
"call with value of function."


Reply via email to