Noah Lavine <noah.b.lav...@gmail.com> writes: > Hello, > > I've been working on a patch to add a new sort of optimization to > peval, and I think it's almost ready. It's based on some of the ideas > in "Environment Analysis of Higher-Order Languages". > > The goal is to recognize when two quantities are equal even when we > don't know what they are. My working example has been this expression: > > (let* ((x (random)) > (y x)) > (eq? x y)) > > The patch attached to this message lets peval optimize that to > > (begin (random) #t)
I have a hard time imagining this optimization to be useful for any code occuring in practice. Can you suggest an example that would make more sense than demonstrating that the optimization works? Is this supposed to help with automatically generated code like macros? -- David Kastrup