\"R passes promises, not values. The promise is forced when it is first evaluated, not when it is passed.\", see this answer by G. Grothendieck. Also see this question referring
R has a function that helps safeguard against lazy evaluation, in situations like closure creation: forceAndCall()
.
From the online R help documentation:
forceAndCall
is intended to help defining higher order functions like apply to behave more reasonably when the result returned by the function applied is a closure that captured its arguments.