Tim> I'm actually starting to think that this may be a good use case for Tim> views of strings i.e. rather than create 3 new strings, each Tim> "string" is a view onto the string that was partitioned. How would this work? One of the advantages of the current string is that the underlying data is NUL-terminated, so when passing strings to C routines no copying is required. Suppose I executed scheme, _, rest = "http://www.python.org/".partition(':') As a Python programmer I'd get back what look like three strings: "http", ":", and "//www.python.org/". If each of them was a view onto part of the original string, only the last one would truly refer to a NUL-terminated sequence of characters. If I then wanted to see what scheme's value compared to, the string's comparison method would have to recognize that it wasn't truly NUL-terminated, copy it, call strncmp() or whatever underlying routine is used for string comparisons. (Maybe string comparisons are done inline. I'm sure there are some examples where the underlying C string routines are called.) OTOH, maybe that would work. Perhaps we should try it. Skip
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