Skip to content

The R5RS library

Given a file named “main.scm” with:

(import (scheme r5rs))
(write (+ 40 2))

When I successfully run stak main.scm

Then the stdout should contain exactly “42”.

Given a file named “main.scm” with:

(import (scheme r5rs))
(for-each write-char '(#\A #\B #\C))

When I successfully run stak main.scm

Then the stdout should contain exactly “ABC”.

Given a file named “main.scm” with:

(import (scheme r5rs))
(write (read))

And a file named “input.txt” with:

(1 2 3)

When I run stak main.scm interactively

And I pipe in the file “input.txt”

Then the exit status should be 0

And the stdout should contain exactly “(1 2 3)”.

Given a file named “main.scm” with:

(import (scheme r5rs))
(write '(1 2 3))

When I successfully run stak main.scm

Then the stdout should contain exactly “(1 2 3)”.

Given a file named “main.scm” with:

(import (scheme r5rs))
(write-char (force (delay (integer->char 65))))

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

Given a file named “main.scm” with:

(import (scheme r5rs))
(write
(eval
'(+ 40 2)
(scheme-report-environment 5)))

When I successfully run stak main.scm

Then the stdout should contain exactly “42”.

Given a file named “main.scm” with:

(import (scheme r5rs))
(write-char (if (= <expression> 2) #\A #\B))

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

expression
(exact->inexact 2)
(inexact->exact 2)
(inexact->exact (exact->inexact 2))

Given a file named “main.scm” with:

(import (scheme r5rs))
(null-environment 5)
(write-char #\A)

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

Given a file named “main.scm” with:

(import (scheme r5rs) (scheme eval))
(load "./foo.scm" (environment '(scheme base)))

And a file named “foo.scm” with:

(write-u8 65)

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.