Skip to content

Optimization

Given a file named “main.scm” with:

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

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

Given a file named “main.scm” with:

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

When I successfully run stak main.scm

Then the stdout should contain exactly “A”.

Given a file named “main.scm” with:

(import (scheme base) (stak base))
(define-optimizer foo
(syntax-rules ()
((foo x ...)
(for-each write-u8 (list x ...)))))
(foo 65 66 67)

When I successfully run stak main.scm

Then the stdout should contain exactly “ABC”.