source: project/chicken/trunk/tests/compiler-tests-2.scm @ 15543

Last change on this file since 15543 was 15543, checked in by felix winkelmann, 10 years ago

merged inlining branch (r15318:15542) into trunk; updated bootstrap tarball; bumped version to 4.1.4

File size: 656 bytes
Line 
1;;; compiler-tests-2.scm - tests for compiler with -lambda-lift
2
3
4;;; rev. 12113 - lambda-lifting breakage, because lambda-bound variables
5;                were incorrectly marked as global (analysis didn't walk
6;                "lambda" nodes correctly, due t incorrect assumption
7;                that "lambda" doesn't occur. Major stupidity.
8;                Test case by Joerg Wittenberger
9
10(define (plus1 a)
11 (define (plus b)
12   (+ a b))
13 (plus 1))
14
15(assert (= 2 (plus1 1)))
16
17(define (len lst)
18 (define (len n)
19   (if (pair? lst)
20       (begin
21         (set! lst (cdr lst))
22         (len (+ n 1)))
23       n))
24 (len 0))
25
26(assert (= 3 (len '(1 2 3))))
Note: See TracBrowser for help on using the repository browser.