3 ms·
A text string standalone data type (maybe called Text) that supports traversal/iteration, subsetting/slicing, containment checking, and has a finite known lengt
by nerdponx 6y ago
A text string standalone data type (maybe called Text) that supports traversal/iteration, subsetting/slicing, containment checking, and has a finite known length.
Internally it can be a list or array or whatever.
Traversal could yield Character objects, which would correspond to Unicode code points (the easy but less-good option, like in Python) or extended grapheme clusters (the actually useful option, like in Swift [0]).
It should also be easy to convert to/from a list or array of raw bytes.
[0]: https://docs.swift.org/swift-book/LanguageGuide/StringsAndCharacters.html https://docs.swift.org/swift-book/LanguageGuide/StringsAndCh...