Great analysis Guido, thanks. GvR> Strings are very important in lots of programs, and we want GvR> our notations for string operations to be readable and GvR> expressive. (Regular expressions are extreme in GvR> expressiveness, but lack readability, which is why they're GvR> relegated to an imported module in Python.) Substring GvR> containment testing is a common operation on strings, so GvR> being able to write it as 's1 in s2' rather than 's2.find(s1) GvR> >= 0' is a big win, IMO. I agree completely. The other thing about strings is that they are of a dual nature, being both a sequence of characters, and an atomic object. At least, /I/ usually think about strings as whole units, except when I want to slice and dice them. And "substr in str" is just such a natural extension of "char in str" because when I do the former, I'm still thinking about looking for a substring, just one of a single character in length. -Barry
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4