-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enumerated properties should have to/from ICU4C APIs #6067
Comments
I'm fine adding these, since as you observed this is already part of our observable behavior via TrieValue. Prefer explicitly-named functions as usual. Perhaps |
Fine by me |
The PR uses the names in the OP. I don't have a record of us deciding on those names over #6067 (comment). |
I implemented @Manishearth's proposal as you proposed two names. I'll leave this open if you want to find-replace the names. |
My impression of the names:
So my preference on the name would probably be: 2 > 1 > 3 |
I like 2 as well. No strong opinion, 2 ~> 1 > 3. |
I like |
Another suggestion: |
@eggrobin pointed out that C enums are integers; there is no casting involved. However, @Manishearth points out that this depends on With this information, I am slightly more okay with Choices:
Vote:
|
@Manishearth: (I do not think that raw is necessary and it feels like additional info to confuse people) |
That is a GCC flag. In C++, you need a cast; there is no such thing as fpermissive in clang or msvc. |
@echeran Please vote. |
They can be re-renamed when unicode-org#6067 is fixed, if desired.
Our enumerated properties are opaque wrappers around integers, using the same values used by ICU4C.
It's reasonable to abstract away our internal implementation, but the ICU4C values are pretty standard across i18n code, and it's reasonable to wish to access these values.
We should offer to/from u8 (or u16) APIs.
I propose we name them
to_icu4c_value()
andfrom_icu4c_value()
, linking to ICU4C docs. There is no fallibility, unknown values are accepted.I am not opposed to just having Into/From and documenting the impl as stably producing ICU4C values.
cc @sffc @echeran @robertbastian
The text was updated successfully, but these errors were encountered: