Though I don't know any "normal" character that requires composition ad-hoc that could serve as a better example.
Though I don't know any "normal" character that requires composition ad-hoc that could serve as a better example.
That said, the grapheme cluster note will have examples of extended notions of characters that can't be represented by an equivalent single codepoint. There are some korean and indic examples and also emoji http://unicode.org/reports/tr29/
Oh and something that stirs the heart of us hackers: \r\n is a single grapheme!
visually_empty(s) is okay, len(s) is probably not.
[0]: When I say 'lists', I mean whatever the standard idea of a sequence of things is in the language. For C that's the array, or maybe the pointer+length pair. For Go it's a slice. For Rust, an iterator perhaps? For Python, it's a list.
How about these?