3 ms·
Not to my knowledge. C++ and Java are statically typed and they, as far as I know, don't have distinction between string interface and implementation, just a s
by drdaeman 13y ago
Not to my knowledge.
C++ and Java are statically typed and they, as far as I know, don't have distinction between string interface and implementation, just a standard string type. You can't make your own string implementation and make others (given that - would it exist - they use standard string interface) transparently accept them instead of language's standard string implementation.
Even Haskell (with standard Prelude) doesn't have a readily available and widely accepted typeclass for strings. As String is just an alias to [Char], if library writer used that, they won't accept, say, Data.Text (I know, it's a bit distinct thing, but...)
- riffraff 13y agoI was referring to "efforts to separate a type from its implementations", not String specifically, and thinking of containers & co. Although, for example, even java has CharSequence which only gives you access to codepoints in a char sequence, you can inherit from that and create your own.