2 ms·
Let's forget Erlang. We've agreed that conflating [Integer] and string is bad. I can't find the reasoning to back up your claim in your posts; if I miss it,
by shiro 17y ago
Let's forget Erlang. We've agreed that conflating [Integer] and string is bad.
I can't find the reasoning to back up your claim in your posts; if I miss it, could you point it? I think I explained a few points that a language does not need distinct string type, except from performance reasons.
Note that I've never said that strings shouldn't be a first class citizen. A list of characters is a first class citizen. You can have rich string library on top of lists of characters, plus generic list operators works on them. So, why do you want a string type disjoint from lists?
- jimbokun 17y agoIt seems the key is having a good "Char" type, so that Unicode bytes turn into something matching the intuition of what a character should be. So the bytes for "a umlaut" or whatever become a single Char in the list. So the Char type is responsible for storing a representing characters at the right level of granularity, and then string operations can all be implemented as list operations. Is there a case where this still breaks down?
- amix 17y agoI didn't specify that a string should be a distinct datatype, but merely a datatype and a first class citizen of a language. If a language's type system is strong enough, then obviously a distinct data type isn't needed.