For Gauche 0.9.5

Next: , Previous: , Up: Library modules - R7RS integration   [Contents][Index]

10.12 scheme.lazy - R7RS lazy evaluation

Module: scheme.lazy

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?
Special Form: delay-force promise

[R7RS] This is the same as Gauche’s built-in lazy. see Delay force and lazy for the discussion about when this form should be used.

Function: make-promise obj

[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 force.

If you write Gauche-specific code, however, force can take non-promise values, so you don’t need this.

Next: , Previous: , Up: Library modules - R7RS integration   [Contents][Index]