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

Cached mappers potentially traverse expressions multiple times in different function contexts #544

Open
majosm opened this issue Sep 13, 2024 · 0 comments

Comments

@majosm
Copy link
Collaborator

majosm commented Sep 13, 2024

Currently, cached mappers clone themselves with a fresh cache when encountering a function definition. This means that if an expression appears both inside and outside the function, it will be traversed twice. Potentially this could be avoided by caching globally, but currently this can't be done because Placeholders are not globally unique (e.g., a placeholder coming from compilation or from a parent function may have the same name as an argument to the current function, making the two equal even though they represent different things). It might be possible to tag placeholders with the function context somehow in order to make them unique, but I don't currently know of a 100% reliable way to do that.

(@inducer Just summarizing what we talked about at the meeting this morning so I don't forget.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant