PageRenderTime 45ms CodeModel.GetById 16ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. (define-macro (check test)
  2. `(if (not ,test) (error "Error in test" ',test)))
  3. (b "hello")
  4. (check (string=? (b) "hello"))
  5. (define sa (new-A))
  6. (A-x-set sa 5)
  7. (a sa)
  8. (check (= (A-x-get (a)) 5))
  9. (ap sa)
  10. (check (= (A-x-get (ap)) 5))
  11. (A-x-set sa 10)
  12. (check (= (A-x-get (ap)) 10))
  13. (define sa2 (new-A))
  14. (A-x-set sa2 -4)
  15. (cap sa2)
  16. (check (= (A-x-get (cap)) -4))
  17. (A-x-set sa2 -7)
  18. (check (= (A-x-get (cap)) -7))
  19. (check (= (A-x-get (ar)) 5))
  20. (ar sa2)
  21. (check (= (A-x-get (ar)) -7))
  22. (x 4)
  23. (check (= (x) 4))
  24. (exit 0)