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

Declare that f is applied iteratively in map! #47012

Closed

Conversation

CameronBieganek
Copy link
Contributor

Fixes #46352.

A consensus has not been reached in #46352, so this represents my opinion on the correct resolution of that issue. Basically, my resolution is to declare the existing behavior as correct and assert that f is applied iteratively in map!. Given the possibility of aliasing, and given that map! is intended to act in-place on the destination collection, I think this is the only feasible definition.

I added the unit tests outside of the generic_map_tests() function, because I don't think the "iteratively apply f" definition would make sense for asyncmap!. Please correct me if I am wrong. There appears to be an effort to have the various mapping functions have as similar a behavior as possible, but they are different functions after all, so I think it's ok to have some variation in the documented behaviors.

@CameronBieganek
Copy link
Contributor Author

Bump. Does anyone have an opinion on this?

@CameronBieganek
Copy link
Contributor Author

No one is ever going to review this, so I might as well close it.

@vtjnash
Copy link
Sponsor Member

vtjnash commented Apr 4, 2023

I think there may be exceptions (e.g. SparseArrays) to this, so it may not be quite right to say it is necessarily the same order as iteration, only that eventually each element will be updated once.

@CameronBieganek
Copy link
Contributor Author

Ok, thanks!

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

Successfully merging this pull request may close these issues.

map! does not check for aliasing
2 participants