-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Rename isupper, islower, ucfirst and lcfirst #26442
Conversation
Since we use C names for character predicates, maybe we should keep |
HISTORY.md
Outdated
@@ -516,7 +516,7 @@ Deprecated or removed | |||
[#18558], [#19711], [#19712], [#19791], [#19802], [#19931], [#20543], [#20228]). | |||
|
|||
* All methods of character predicates (`isalnum`, `isalpha`, `iscntrl`, `isdigit`, | |||
`isnumber`, `isgraph`, `islower`, `isprint`, `ispunct`, `isspace`, `isupper`, | |||
`isnumber`, `isgraph`, `islowercase`, `isprint`, `ispunct`, `isspace`, `isuppercase`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The history file should not be changed.
That's a possibility and it would give shorter identifiers. However the "to" prefix doesn't convey very useful information, and AFAIK we don't use it anywhere else. |
Another advantage of using "case" everywhere is that it's consistent with the |
We're increasingly deviating from the C names for these and the C names are pretty bad to begin with. I think we should just pick a good set of names for these and be guided by other high-level languages like Python and Ruby (and Swift, etc.). |
Ok, I'm fine with the names in this PR. Just throwing out some options. |
Spell "uppercase" and "lowercase" in full for consistency with uppercase and lowercase functions.
Spell "uppercase" and "lowercase" in full for consistency with
uppercase
andlowercase
functions.The current function names seem to be inspired from different languages (Python and Perl), and are therefore inconsistent. Here's a small survey of what other languages use:
* long:
CharacterSet.uppercaseLetters.contains(c)
andCharacterSet.lowercaseLetters.contains(c)
.