-
-
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
Feature request: Remove array type assertion for find to allow other iterables #16022
Comments
Makes sense. In that case, I also change |
Oh, and would you mind preparing a PR (maybe wait for a bit in case somebody disagrees with your proposal)? |
@nalimilan I'm not sure what you mean about changing the Regarding the PR, sure that'd be no problem, though the change I'm proposing would be as simple as removing |
|
@nalimilan Out of curiosity, what would you expect The more I think about this, the more it seems like the |
Giving all the indices of non-NUL characters would be a pretty weird behavior for this. |
@StefanKarpinski Yeah, I can't think of a result that would make sense for |
I think that having |
Pull requested! 😄 I made it so that |
-1 That's would be inconsistent with the definition of |
The problem with making string input a |
You're right, though with the idea of making |
Closed by #16110 |
Other
find
-like functions, e.g.findfirst
,findlast
,findprev
, etc., accept a string argument because the type of the iterable doesn't matter, butfind
requires anAbstractArray
. Consider the following code, which is howfind
is implemented as of this writing:It seems to me that it would work just as well to remove the type for
A
, which would make this function more consistent with itsfind
-like friends.Thoughts?
The text was updated successfully, but these errors were encountered: