Add EAGER from SRFI 45
|Reported by:||cowan||Owned by:||cowan|
|Component:||WG1 - Core||Keywords:|
eager, like delay, returns a promise object that can be forced by force, but it evaluates its argument up front (it is a procedure, not syntax) and stashes it in the promise in such a way that force can access it. It comes from SRFI 45 and complements lazy, delay, and force, also from SRFI 45, that we now have.
Semantically, writing (eager expression) is equivalent to writing (let ((value expression)) (delay value)). However, the former is more efficient since it does not require unnecessary creation and evaluation of thunks. And you can't make eager efficient yourself unless you have access to the internals of force.