CALL-BY-NAME
\kˈɔːlba͡ɪnˈe͡ɪm], \kˈɔːlbaɪnˈeɪm], \k_ˈɔː_l_b_aɪ_n_ˈeɪ_m]\
Sort: Oldest first
-
(CBN) (Normal order reduction, leftmost, outermostreduction). An argument passing convention (first providedby ALGOL 60?) where argument expressions are passedunevaluated. This is usually implemented by passing a pointerto a thunk - some code which will return the value of theargument and an environment giving the values of its freevariables.This evaluation strategy is guaranteed to reach a normalform if one exists.When used to implement functional programming languages,call-by-name is usually combined with graph reduction toavoid repeated evaluation of the same expression. This isthen known as call-by-need.The opposite of call-by-name is call-by-value wherearguments are evaluated before they are passed to a function.This is more efficient but is less likely to terminate in thepresence of infinite data structures and recursivefunctions.Arguments to macros are usually passed using call-by-name.
By Denis Howe