Agreed, but if the Unicode name is directly at odds with what we expect user intuition to be, I'd prefer it to be as explicitly qualified as possible. An example could be the property isEmoji
, which doesn't really behave how a non-Unicode expert would expect: ("7" as Unicode.Scalar).properties.isEmoji == true
.
You'll be happy to know Unicode has several quirky notions of "lowercase" This is an argument for surfacing the raw UCD data as directly and explicitly as we can without interpretation (which is the aim of this pitch). I worry that Unicode.Scalar.isLowercase
would be ambiguous as to which notion of lowercase (and potentially at-odds with other String API), while something explicitly calling out "properties" or in a UCD-accessing namespace gives better context.
I think my main argument is that just "Unicode" and "Scalar" is an insufficient context for directly surfacing properties with Unicode's terminology. I feel that "Property" (which the Unicode standard always uses in this context) should be in the spelling somehow.
For other Unicode.Scalar
API, we don't have that constraint and can tackle them as needed.
Not quite. Unicode defines Character Properties*, one of which is called Name. Unicode.Scalar.Properties.name
directly corresponds to that property. I suppose it could be spelled Unicode.Scalar.nameProperty
or Unicode.Scalar.getStringProperty(.name)
, where "property" echos direct correspondence to Unicode Character Properties.
This direct correspondence is also why I'm wary of breaking the link or changing the name or meaning to anything other than directly echoing the standard.
* In Unicode parlance, "character" is vague but usually ends up meaning scalar or code point.