bug-guile  

bug#10756: [2.0.5+] Miscompilation with peval: local shadows module-ref

Andy Wingo
Thu, 09 Feb 2012 05:18:09 -0800

On Wed 08 Feb 2012 00:04, l...@gnu.org (Ludovic Courtès) writes:

> scheme@(guile-user)> ,optimize (define (foo) (define bar (@ (chbouib) bar)) 
> bar)
> $11 = (define foo
>   (lambda ()
>     (let ((bar-1510 (if #f #f)))
>       (letrec*
>         ()
>         (begin (set! bar-1510 bar-1510) bar-1510)))))
>
> Here, the ‘bar’ local is always set to *undefined*, wrongfully.

It's actually an expander bug:

scheme@(guile-user)> ,expand (define (foo) (define bar (@ (chbouib) bar)) bar)
$2 = (define foo
  (lambda () (letrec* ((bar-92 bar-92)) bar-92)))

Andy
-- 
http://wingolog.org/