bug#9542: peval error

2011-09-18 Thread Ludovic Courtès
Hi, Andy Wingo skribis: > Here we see that `fold' was inlined once, but to no use. More code for > no more speed. > > Waddell and Dybvig report on similar problems in their inlining paper > (Fast and Effective Procedure Inlining, IU CS Dept. TR 484). See > section 4.4 where they discuss this a

bug#9542: peval error

2011-09-18 Thread Ludovic Courtès
Hi Andy, Andy Wingo skribis: > Still, though, the results are not great: [...] > Here we see that `fold' was inlined once, but to no use. More code for > no more speed. Yes. OTOH, it was inlined *and* specialized; peval only “inlines” where’s there’s at least one static argument (known at c

Re: peval error

2011-09-17 Thread Andy Wingo
On Sat 17 Sep 2011 07:52, l...@gnu.org (Ludovic Courtès) writes: > Hopefully fixed! Thanks! Still, though, the results are not great: (define exp '(define (fact x) (letrec ((fold (lambda (f x b null? car cdr) (if (null? x) b

Re: peval error

2011-09-17 Thread Ludovic Courtès
Hi, Andy Wingo skribis: > On Fri 16 Sep 2011 03:02, l...@gnu.org (Ludovic Courtès) writes: > >> Renaming one of the #{x2 2899}# fixes the problem. > > Yes, whenever you introduce a new binding (for example, by inlining), > you will need to rename the newly bound variable. Hopefully fixed! h

Re: peval error

2011-09-17 Thread Ludovic Courtès
Hi Andy, Andy Wingo skribis: > On Fri 16 Sep 2011 03:02, l...@gnu.org (Ludovic Courtès) writes: > >> Renaming one of the #{x2 2899}# fixes the problem. > > Yes, whenever you introduce a new binding (for example, by inlining), > you will need to rename the newly bound variable. OK, I’ll do that.

Re: peval error

2011-09-16 Thread Andy Wingo
Hi, On Fri 16 Sep 2011 03:02, l...@gnu.org (Ludovic Courtès) writes: > Renaming one of the #{x2 2899}# fixes the problem. Yes, whenever you introduce a new binding (for example, by inlining), you will need to rename the newly bound variable. Andy -- http://wingolog.org/

Re: peval error

2011-09-16 Thread Ludovic Courtès
Hi, l...@gnu.org (Ludovic Courtès) skribis: > Apparently the problem stems from the fact that it uses the same gensyms > in different places, which breaks the assumption behind > ‘vars->bind-list’, as shown with this excerpt of partial evaluation of > your expression: Here’s a simpler test case:

Re: peval error

2011-09-15 Thread Ludovic Courtès
Hi Andy! Andy Wingo skribis: > Hi Ludo, > > On Tue 13 Sep 2011 10:04, l...@gnu.org (Ludovic Courtès) writes: > >> Andy Wingo skribis: >> >>> I'm excited about the partial evaluator. > > I'm still excited about it! Thanks for persevering! :-) >>> (letrec ((fold (lambda (f x b null? car cdr)

Re: peval error

2011-09-15 Thread Andy Wingo
Hi Ludo, On Tue 13 Sep 2011 10:04, l...@gnu.org (Ludovic Courtès) writes: > Andy Wingo skribis: > >> I'm excited about the partial evaluator. I'm still excited about it! >> (letrec ((fold (lambda (f x b null? car cdr) >>(if (null? x) >>b >>

Re: peval error

2011-09-13 Thread Ludovic Courtès
Hi, Andy Wingo skribis: > I'm excited about the partial evaluator. However there is one error > I've found: > > (letrec ((fold (lambda (f x b null? car cdr) >(if (null? x) >b >(f (car x) (fold f (cdr x) b null? car cdr))

Re: peval error

2011-09-10 Thread Ludovic Courtès
Hi Andy, Thanks for the report! Andy Wingo skribis: > I'm excited about the partial evaluator. However there is one error > I've found: > > (letrec ((fold (lambda (f x b null? car cdr) >(if (null? x) >b >(f (car x) (fold f (

peval error

2011-09-10 Thread Andy Wingo
Hi! I'm excited about the partial evaluator. However there is one error I've found: (letrec ((fold (lambda (f x b null? car cdr) (if (null? x) b (f (car x) (fold f (cdr x) b null? car cdr)) (fold * x 1 zero? (lambda (x) x