Procedure
Call a global procedure
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Call a local procedure
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Call an immediate procedure
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Call nested immediate procedures
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Return a constant
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Return the first argument
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Return the second argument
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Compute a value with arguments
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Update a captured variable in a closure
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “ABC”.
Use variadic arguments
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “ABC”.
Use variadic arguments with a fixed argument
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “ABC”.
Call a fibonacci procedure
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “X”.
Call an apply
procedure
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “<output>”.
Examples
values | output |
---|---|
0 | |
1 | 1 |
1 2 | 3 |
1 2 3 | 6 |
Call an apply
procedure with a correct argument order
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “<output>”.
Examples
values | output |
---|---|
() | |
() () | |
(65) | A |
(65) (66) | AB |
(65) (66) (67) | ABC |
(65 66) (67 68) | ABCD |
(65 66) (67 68) (69 70) | ABCDEF |
Call an apply
procedure with a fixed number of arguments
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Call an apply
procedure twice with the same list
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “AA”.
Call an apply
procedure with extra arguments
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “D”.
Call an apply
procedure with a primitive procedure
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Call immediate procedures capturing a local variable
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “ABC”.
Call a procedure with too few arguments
Given a file named “main.scm” with:
When I run scheme main.scm
Then the exit status should not be 0.
Call a procedure with too many arguments
Given a file named “main.scm” with:
When I run scheme main.scm
Then the exit status should not be 0.
Do not modify environment of a reused closure with a primitive procedure
Given a file named “main.scm” with:
When I run scheme main.scm
Then the stdout should contain exactly “ABC”.