Repository navigation
Conversation
For loops of the form `(let loop ([x e] ...) body)`, bind the e's outside the `letrec` when they are `simple?` so that the extra `let`s needed to ensure left-to-right evaluation don't interfere with Chez-level loop detection. Also, fix the implementation of `simple?` for `set!` forms.
|
This looks like a case where it's better to adjust Chez Scheme. I think you're aiming to cover an example like where the I see that the change would cover this case, but with a couple of limitations:
The loop-detection pass in Chez Scheme has the information that I have to test more, but I think this commit may be the right idea: mflatt/ChezScheme@f754d7c |
|
That seems like a better improvement. I think the change to simple? should be kept. If you're looking at loop recognition code, you might also be interested in this commit: samth@e5cabda That's relatively easy to work around as well by explicitly using let loop, but it did come up in the mandelbrot benchmark we were looking at. |
It turns out that something like that (generalized) is need to make stable tests, since cp0 may move an application around |
The handling of `set!` was incorrect for non-pure mode (partial correction in #5590), non-pure mode was too restructive with respect to mutable variables, and some transformations required a non-pure simple expression unnecessarily.
|
Obsoleted by cisco/ChezScheme#1069 |
For loops of the form
(let loop ([x e] ...) body), bind the e's outside theletrecwhen they aresimple?so that the extralets needed to ensure left-to-right evaluation don't interfere with Chez-level loop detection.Also, fix the implementation of
simple?forset!forms.