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