scheme.lazy- R7RS lazy evaluation
Exports bindings of R7RS
(scheme lazy) library.
From R7RS programs,
those bindings are available by
(import (scheme lazy)).
The following bindings this module provides are Gauche built-ins (see Delay force and lazy).
delay force promise?
This is the same as Gauche’s built-in
see Delay force and lazy for the discussion about when this
form should be used.
[R7RS] If obj is a promise, it is returned as is. Otherwise, A promise, which yields obj when forced, is returned. Because this is a procedure, expression passed as obj is eagerly evaluated, so this doesn’t have effect on lazy evaluation, but can be used to ensure you have a promise.
This procedure is important on implementations where
force only takes a promise, and portable code should
use this procedure to yield a value that can be passed to
If you write Gauche-specific code, however,
force can take
non-promise values, so you don’t need this.