-
Notifications
You must be signed in to change notification settings - Fork 365
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
Exceptionless string to number conversions #19
Comments
Have you considered returning some "error" state rather than null. Something that could indicate why the string was not convertible (eg, "found 'a' expected 0-9). For this you would need to add some kind of Eg,
|
For a solution focused on performance, you can consider something like
that would avoid allocating any objects for result, and could be used like
Naming scheme is similar to |
@dnpetrov I thought about something like |
What''s the status on this issue? I don't see a set target version in https://youtrack.jetbrains.com/issue/KT-7930, so I assume the discussion is in the process. |
A major problem I see with On the other hand, |
From my point of view, in practice there are two major use cases:
IMHO, |
A note: I am not sure how it is possible to implement
|
These are exactly my concerns about We have found another option to provide 'boxingless' conversion: Often, one might have sensible default value from the same domain: These functions might be provided in addition to |
@ilya-g completely agree on the above I don't see the benefits of introducing 8 functions for avoiding one boxing. According to my theory #19 (comment) use cases that would significantly benefit from those do no exist |
I'll remove a link to https://youtrack.jetbrains.com/issue/KT-9374 as it doesn't relate to this proposal |
Discussions about the exceptionless string to number conversions will be held here.
The text was updated successfully, but these errors were encountered: