Closed rekado closed 8 years ago
Bummer. Are there any plans to add garbage collection? Or to pin lambdas automatically?
Either of those would be brilliant, and I have spent a lot of time thinking about them, but they are not easy. It seems garbage collection will require deep changes to the runtime system, and lambda lifting might require equally deep changes to the compiler architecture. Honestly, I don't know if I'll ever have the time to do it myself, but then, that's the point of open-sourcing isn't it! ;-)
To clarify: it's not just a time issue... I haven't really worked out how to do it :)
When I run this on an ATmega32, after just a few seconds an exception is signaled (different exceptions dependent on what happens in the lambda).
It doesn't matter what value is returned in the lambda. The same behaviour can be observed when I replace the lambda with a procedure that's defined outside of the loop.
Seems that there's something wrong with
for-each
.