PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/schemerunme/global_vars.scm

#
Lisp | 31 lines | 24 code | 7 blank | 0 comment | 0 complexity | 77f93e5aba79e78635abde9a4a1809f8 MD5 | raw file
 1(define-macro (check test)
 2  `(if (not ,test) (error "Error in test" ',test)))
 3
 4(b "hello")
 5(check (string=? (b) "hello"))
 6
 7(define sa (new-A))
 8(A-x-set sa 5)
 9(a sa)
10(check (= (A-x-get (a)) 5))
11
12(ap sa)
13(check (= (A-x-get (ap)) 5))
14(A-x-set sa 10)
15(check (= (A-x-get (ap)) 10))
16
17(define sa2 (new-A))
18(A-x-set sa2 -4)
19(cap sa2)
20(check (= (A-x-get (cap)) -4))
21(A-x-set sa2 -7)
22(check (= (A-x-get (cap)) -7))
23
24(check (= (A-x-get (ar)) 5))
25(ar sa2)
26(check (= (A-x-get (ar)) -7))
27
28(x 4)
29(check (= (x) 4))
30
31(exit 0)