-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Delete map(f, ::AbstractString)
special case
#57071
Comments
The tuple case is also a special case, though imo a much more reasonable special case. |
First step: add |
Right now we're in this weird halfway point where it sometimes returns a |
As I said in #51703, I think it's necessary to decide if
But abstract types are somewhat restrictive. It would be more flexible if we adopted option 2:
If |
map on a String (currently) does not preserve indices, since it is indexed by byte offsets but iterates by characters, so it is a fairly specific special case to whatever definition we use |
Example of what Jameson is talking about: julia> let str = "αγβ"
str2 = map(_ -> 'c', str)
collect(eachindex(str)), collect(eachindex(str2))
end
([1, 3, 5], [1, 2, 3]) |
I'm sold on removal then. |
Should we document that |
Do we actually want this?
Is it worth the break from the typical semantics of
map
where the function always returns anAbstractArray
?Can we rename this method to
stringmap
?The text was updated successfully, but these errors were encountered: