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

Last change on this file since 12114 was 12114, checked in by felix winkelmann, 12 years ago

fixed lambda-lifting (actually analyzer) bug reported by Joerg Wittenberger

File size: 642 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(print (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(print (len '(1 2 3)))
Note: See TracBrowser for help on using the repository browser.