Open eholk opened 11 years ago
This can be solved without removing set!
entirely; i.e. we could just do an assigned-variable analysis. I'm not saying that is necessarily the right way to go, but doing that analysis would probably help out some other passes as well.
Yeah, that makes sense. I was worried that the assigned variable analysis might be kind of intricate, but I guess not. As you say, the analysis will probably be helpful anyway. For example, named let will probably expand into set!
s and gotos.
I suspect this bug explains why our Mandelbrot programs only generate white images now.
This came up while working on a library version of reduce:
With the print statements uncommented, the code works correctly. It seems the
(let ((len (/ (length xs) 2))) ...)
section gets lifted above the while loop, since the lifter assumes xs never changes.This is probably a good argument for removing
set!
entirely in favor of named let.