[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Re: -lambda-lift broken in trunk

From: F. Wittenberger
Subject: [Chicken-users] Re: -lambda-lift broken in trunk
Date: Fri, 03 Oct 2008 18:09:59 +0200

I guess I have a better test case for you.

"plus1" was my 1st attempt to simplify the code.  Too much however, this
one prints "2".  "len" has almost the same structure - but breaks.

cat << EOF > t-lambdalift.scm
(define (plus1 a)
  (define (plus b)
    (+ a b))
  (plus 1))

(print (plus1 1))

(define (len lst)
  (define (len n)
    (if (pair? lst)
          (set! lst (cdr lst))
          (len (+ n 1)))
  (len 0))

(print (len '(1 2 3)))
$csc -lambda-lift  t-lambdalift.scm 
$ ./t-lambdalift 
Error: unbound variable: lst13

        Call history:

        t-lambdalift.scm: 6    plus1            
        t-lambdalift.scm: 6    print            
        t-lambdalift.scm: 17   len              
        t-lambdalift.scm: 15   len                      <--

reply via email to

[Prev in Thread] Current Thread [Next in Thread]