You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is to discuss the proposal to introduce new Char <-> Int conversion API to make conversions unambiguous.
The new API includes:
fun Char(code: Int): Char
val Char.code: Int
fun Char.digitToInt(radix: Int = 10): Int
fun Char.digitToIntOrNull(radix: Int = 10): Int?
fun Int.digitToChar(radix: Int = 10): Char
Char(code) function and Char.code property are so closely related to Char type that they could be placed into kotlin package, or even become members of the Char type itself.
instead of providing default value for radix, the functions digitToInt, digitToIntOrNull, digitToChar could have overloads with and without radix, similar to String.toInt and String.toIntOrNull. The motivation is the same: the implementation with the constant radix equal to 10 can be made more efficient.
This issue is to discuss the proposal to introduce new
Char
<->Int
conversion API to make conversions unambiguous.The new API includes:
The proposal text is here: https://github.com/Kotlin/KEEP/blob/master/proposals/stdlib/char-int-conversions.md.
The text was updated successfully, but these errors were encountered: