Load
Load a file
Section titled “Load a file”Given a file named “main.scm” with:
(import (scheme base) (scheme eval) (scheme load))
(load "./foo.scm" (environment '(scheme base)))
And a file named “foo.scm” with:
(write-string "foo")
When I successfully run stak main.scm
Then the stdout should contain exactly “foo”.
Load two files
Section titled “Load two files”Given a file named “main.scm” with:
(import (scheme base) (scheme eval) (scheme load))
(load "./foo.scm" (environment '(scheme base)))(load "./bar.scm" (environment '(scheme base)))
And a file named “foo.scm” with:
(write-string "foo")
And a file named “bar.scm” with:
(write-string "bar")
When I successfully run stak main.scm
Then the stdout should contain exactly “foobar”.
Load a file in an loaded file
Section titled “Load a file in an loaded file”Given a file named “main.scm” with:
(import (scheme base) (scheme eval) (scheme load))
(load "./foo.scm" (environment '(scheme base) '(scheme eval) '(scheme load)))
And a file named “foo.scm” with:
(load "./bar.scm" (environment '(scheme base)))
And a file named “bar.scm” with:
(write-string "bar")
When I successfully run stak main.scm
Then the stdout should contain exactly “bar”.