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

From: Andy Wingo <[email-masked]>
Date: Thu, 09 Feb 2012 14:17:22 +0100

On Wed 08 Feb 2012 00:04, [email-masked] (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/