https://github.com/JuliaLang/julia/pull/26286#issuecomment-369771199
@stevengj you said that you didn’t understand the need for CodePoint.
Take a look at the README and the code where I define CodePoint, it is used throughout the package:
https://github.com/JuliaString/Strs.jl
CodePoint
allows one to have separate code point types for ASCII, Latin1, UCS2 (BMP only Unicode), and UTF32 (full valid Unicode), as well as other types to represent “raw” 1, 2, 4 byte text values, or binary values.
That way optimized code can be generated for things like isvalid
or isascii
.
I’d rather though that (for now at least) CodePoint
were left out of base, and just have AbstractChar
for now, which would be the supertype of both Char
from Base and my own CodePoint
.