Skip to content

Optimization

Given a file named “main.scm” with:

(import (scheme base) (scheme write) (stak base))
(define-optimizer foo
(syntax-rules ()
((foo)
(write 42))))
(foo)

When I successfully run stak main.scm

Then the stdout should contain exactly “42”.

Given a file named “main.scm” with:

(import (scheme base) (scheme write) (stak base))
(define-optimizer foo
(syntax-rules ()
((foo x)
(write x))))
(foo 42)

When I successfully run stak main.scm

Then the stdout should contain exactly “42”.

Given a file named “main.scm” with:

(import (scheme base) (scheme write) (stak base))
(define-optimizer foo
(syntax-rules ()
((foo x ...)
(write (list x ...)))))
(foo 1 2 3)

When I successfully run stak main.scm

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