CallByNeed is a further modification to the CallByReference scheme of passing values to functions. In CallByNeed we extend the thunk with a memoization slot. When we first evaluate the contents of the thunk we store the result in the memoization slot of the thunk. Next time we need to evaluate the expression, we can do it in constant time due to the memoization slot.

CallByNeed (last edited 2008-07-09 05:47:54 by localhost)