18099, "e-kayrakli", "Rename 'list.indexOf' as 'list.find' and make it not halt on empty lists", "2021-07-22T23:41:00Z"
The list
type has an indexOf
method that returns the index of a given element. This issue has 2 proposals:
- We rename this method as
find
:
We havestring.find
andbytes.find
which are similar. Note thatlist
also hascount
which is the same asstring.count
/bytes.count
. - We make it not halt for empty lists, and return -1 instead.
This is the behavior instring
/bytes
. I don't think runningfind
on an emptylist
warrants such a drastic action.
(In the module review meeting, we have only talked about (1) that had support. We haven't talked about 2, and I can create a separate issue for it if needed)