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

Feature Request: Add map!(f, x) to work as map!(f, x, x) #36432

Closed
Ellipse0934 opened this issue Jun 25, 2020 · 2 comments
Closed

Feature Request: Add map!(f, x) to work as map!(f, x, x) #36432

Ellipse0934 opened this issue Jun 25, 2020 · 2 comments
Labels
duplicate Indicates similar issues or pull requests

Comments

@Ellipse0934
Copy link
Contributor

Currently we have map(f, c...) which applies map to a collection and when the map is supposed to store to a container rather than returning a new one we use map!(f, dest, c...). However, when we have a single container over which we are supposed to apply map, map!(f, x) syntax makes sense. Currently, we do map!(f, x, x).

Example

julia> x = [1., 2, 3]
julia> map!(sqrt, x)
3-element Array{Float64,1}:
 1.0
 1.4142135623730951
 1.7320508075688772
@rfourquet
Copy link
Member

Dup of #31677. map!(f, x) was deprecated, and map!(f, x) could also mean fill destination x with repeated applications of "nullary" f() (call of f with 0 arguments).

@rfourquet rfourquet added the duplicate Indicates similar issues or pull requests label Jun 25, 2020
@Albert55554

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Indicates similar issues or pull requests
Projects
None yet
Development

No branches or pull requests

3 participants