-
Notifications
You must be signed in to change notification settings - Fork 445
Open
Description
I noticed the following asymmetry between list.find and string/bytes.find/rfind
proc list.find(x: eltType, start: int=0, end: int=-1): int
string.find(pattern: string, indices: range(?) = this.byteIndices:range(byteIndex)): byteIndex
string.rfind(pattern: string, indices: range(?) = this.byteIndices:range(byteIndex)): byteIndex
bytes.find(pattern: bytes, indices: range(?) = this.indices) : int
bytes.rfind(pattern: bytes, indices: range(?) = this.indices) : intI find it very odd and asymmetrical that list.find takes a start and end index, while string/bytes.find/rfind takes a range. The range argument feels much more Chapel-tastic and like a better interface; I think list.find should be updated to use that. Doing so is a breaking change, but I think its worth doing
Reactions are currently unavailable