Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest optimizing for/last expressions #431

Open
jackfirth opened this issue Dec 9, 2024 · 0 comments
Open

Suggest optimizing for/last expressions #431

jackfirth opened this issue Dec 9, 2024 · 0 comments
Labels
new lint Issues suggesting new lints or pull requests implementing new lints

Comments

@jackfirth
Copy link
Owner

jackfirth commented Dec 9, 2024

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 jackfirth added the new lint Issues suggesting new lints or pull requests implementing new lints label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new lint Issues suggesting new lints or pull requests implementing new lints
Projects
None yet
Development

No branches or pull requests

1 participant