PageRenderTime 45ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/chicken/multimap/test-multimap.scm

#
Lisp | 59 lines | 45 code | 12 blank | 2 comment | 0 complexity | 77a17a7d6bda3f566342d6aceeb9d447 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. ;; run with './multimap test-multimap.scm'
  2. ;; feel free to uncomment and comment sections
  3. (load-library 'example "multimap.so")
  4. (display "(gcd 90 12): ")
  5. (display (gcd 90 12))
  6. (display "\n")
  7. (display "(circle 0.5 0.5): ")
  8. (display (circle 0.5 0.5))
  9. (display "\n")
  10. (display "(circle 1.0 1.0): ")
  11. (handle-exceptions exvar
  12. (if (= (car exvar) 9)
  13. (display "success: exception thrown")
  14. (display "an incorrect exception was thrown"))
  15. (begin
  16. (circle 1.0 1.0)
  17. (display "an exception was not thrown when it should have been")))
  18. (display "\n")
  19. (display "(circle 1 1): ")
  20. (handle-exceptions exvar
  21. (if (= (car exvar) 9)
  22. (display "success: exception thrown")
  23. (display "an incorrect exception was thrown"))
  24. (begin
  25. (circle 1 1)
  26. (display "an exception was not thrown when it should have been")))
  27. (display "\n")
  28. (display "(capitalize \"will this be all capital letters?\"): ")
  29. (display (capitalize "will this be all capital letters?"))
  30. (display "\n")
  31. (display "(count \"jumpity little spider\" #\\t): ")
  32. (display (count "jumpity little spider" #\t))
  33. (display "\n")
  34. (display "(gcdmain '#(\"hi\" \"there\")): ")
  35. (display (gcdmain '#("hi" "there")))
  36. (display "\n")
  37. (display "(gcdmain '#(\"gcd\" \"9\" \"28\")): ")
  38. (gcdmain '#("gcd" "9" "28"))
  39. (display "\n")
  40. (display "(gcdmain '#(\"gcd\" \"12\" \"90\")): ")
  41. (gcdmain '#("gcd" "12" "90"))
  42. (display "\n")
  43. (display "squarecubed 3: ")
  44. (call-with-values (lambda() (squareCubed 3))
  45. (lambda (a b) (printf "~A ~A" a b)))
  46. (display "\n")
  47. (exit)