This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Tail sets


* Per Bothner [2009-06-29 09:10+0200] writes:

> It took longer than expected, but I finally checked
> in something based on your prototype.

Excellent!

Just two more notes.  

1. It would be cute if code like this:

(define (foo x)
  (letrec ((f (lambda ()
                (if x (f) (g))))
           (g (lambda ()
                (if x (g) (f)))))
    (f)))

wouldn't allocate a frame.

2. This code seems to trigger a bug elsewhere:

(define-syntax mif
  (syntax-rules (quote)
    ((mif ('x value) then else)
     (if (equal? 'x value) then else))
    ((mif (() value) then else)
     (if (eq? value '()) then else))
    ((mif ((p . ps) value) then else)
     (let ((fail (lambda () else))
           (tmp value))
       (if (instance? tmp <pair>)
           (let ((tmp :: <pair> tmp))
             (mif (p tmp:car)
                  (mif (ps tmp:cdr)
                       then
                       (fail))
                  (fail)))
           (fail))))))

(define (foo x)
  (mif (('0 '1 '2 '3 '4 '5 '6 '7 '8 '9) x)
       #t
       #f))

Presumably because this requires now very long jumps.
There are also quite a few jumps to other jumps which could be 
optimized.

Helmut


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]