REPL
Use a base library
Section titled “Use a base library”Given a file named “input.scm” with:
(define (foo x) (+ x 1))(foo 41)When I run stak-repl interactively
And I pipe in the file “input.scm”
Then the exit status should be 0
And the stdout should contain “42”.
Load a file
Section titled “Load a file”Given a file named “foo.scm” with:
(define (foo x) (+ x 1))And a file named “input.scm” with:
(import (scheme load))(load "./foo.scm")(foo 41)When I run stak-repl interactively
And I pipe in the file “input.scm”
Then the exit status should be 0
And the stdout should contain “42”.
Import a library in a data directory
Section titled “Import a library in a data directory”Given a file named “data/stak/foo.sld” with:
(define-library (foo) (export foo)
(import (scheme base))
(begin (define foo 42)))And a file named “input.scm” with:
(import (foo))fooAnd I set the environment variable “XDG_DATA_HOME” to “data”
When I run stak-repl interactively
And I pipe in the file “input.scm”
Then the exit status should be 0
And the stdout should contain “42”.