~ chicken-core (chicken-5) /tests/simple-functors-test.scm


 1;;;; simple-functors-test.scm
 2
 3
 4(define-interface STUFF (a b))
 5
 6(module foo ((interface: STUFF))	; test long spec
 7(import scheme)
 8(define a 1)
 9(define b 2))
10
11(functor 
12 (do-things (arg STUFF)) (do-it)
13 (import scheme arg)
14 (define (do-it) (list a b)))
15
16(module bar = (do-things foo))
17
18(import bar)
19(assert (equal? '(1 2) (do-it)))
20
Trap