Lazy
Delay an expression
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly "".
Check if a value is a promise
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “<output>”.
Examples
value | output |
---|---|
#f | B |
(delay #f) | A |
(make-promise #f) | A |
Force a promise
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Force a promise twice
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Force and delay an expression
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly "".
Force, delay, and force an expression
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Force and delay expressions in a loop
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Make a promise
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.