resyntax icon indicating copy to clipboard operation
resyntax copied to clipboard

Suggest optimizing `for/last` expressions

Open jackfirth opened this issue 1 year ago • 0 comments

The for/last form evaluates the loop body every iteration, even though it often only needs to evaluate it on the last iteration. This is very wasteful when the loop body is computing something whose side effects don't matter. Resyntax ought to suggest something to optimize this, either by manually extracting the body out or by using a new keyword we could add to for/last that tells it to only evaluate the last loop body.

jackfirth avatar Dec 09 '24 21:12 jackfirth