Ticket #1726: test.scm
File test.scm, 539 bytes (added by , 4 years ago) |
---|
Line | |
---|---|
1 | (import (chicken process-context) |
2 | (chicken fixnum)) |
3 | |
4 | (define (A k x1 x2 x3 x4 x5) |
5 | (let |
6 | ([+ fx+] |
7 | [- fx-] |
8 | [<= fx<=]) |
9 | (define (B) |
10 | (set! k (- k 1)) |
11 | (A k B x1 x2 x3 x4)) |
12 | (if (<= k 0) |
13 | (+ (x4) (x5)) |
14 | (B)))) |
15 | |
16 | (define k (let ([args (command-line-arguments)]) |
17 | (if (> (length args) 0) |
18 | (string->number (car args)) |
19 | 10))) |
20 | (print (A k |
21 | (lambda () 1) |
22 | (lambda () -1) |
23 | (lambda () -1) |
24 | (lambda () 1) |
25 | (lambda () 0))) |