import source from 1.3.40
[external/swig.git] / Examples / mzscheme / simple / example.scm
1 ;; run with mzscheme -r example.scm
2
3 (load-extension "example.so")
4
5 (display (get-time))
6
7 (printf "My-variable = ~a~n" (my-variable))
8
9 (let loop ((i 0))
10   (when (< i 14) (begin (display i)
11                         (display " factorial is ")
12                         (display (fact i))
13                         (newline)
14                         (loop (+ i 1)))))
15
16 (let loop ((i 1))
17   (when (< i 250)
18         (begin
19           (let loopi ((j 1))
20             (when (< j 250) (begin (my-variable (+ (my-variable) (mod i j)))
21                                    (loopi (+ j 1)))))
22           (loop (+ i 1)))))
23
24 (printf "My-variable = ~a~n" (my-variable))