This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Tail sets
- From: Helmut Eller <eller dot helmut at gmail dot com>
- To: kawa at sources dot redhat dot com
- Date: Mon, 29 Jun 2009 12:23:55 +0200
- Subject: Re: Tail sets
- References: <87zlfnjhwt.fsf@lifebook.lan> <49BDDA63.6020009@bothner.com> <m2my9fpvm8.fsf@gmail.com> <4A4868D7.2020602@bothner.com>
* 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