Node: Delayed Evaluation, Next: , Previous: Iterations, Up: Expressions



Delayed Evaluation

delay <expression> R5RS
The delay construct is used together with the procedure force to implement lazy evaluation or call by need. (delay <expression>) returns an object called a promise which at some point in the future may be asked (by the force procedure) to evaluate <expression>, and deliver the resulting value. The effect of <expression> returning multiple values is unpredictable.

See the description of force (see force) for a more complete description of delay.

promise? obj STKLOS Procedure
Returns #t if obj is a promise, otherwise returns #f.