-
Notifications
You must be signed in to change notification settings - Fork 141
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
why do we need bytes.as-string, .as-number, .as-i64, etc.? #3580
Comments
@maxonfjvipon WDYT? |
@yegor256 the method |
@maxonfjvipon can't we have these checks inside the |
@yegor256 no, it leads to infinite recursion:
I tried to implement it when I was introducing |
@yegor256 also there's no way we can create |
@maxonfjvipon how about this instead:
|
@yegor256 here when we take |
@maxonfjvipon maybe we can get rid of error checking and accept anything as an argument of |
@yegor256 it's how we do it right now. But someone should validate at least something. I think it's not a really good idea to put all this validation to the end user shoulders. So if we have |
@maxonfjvipon the key problem is a duplication of functionality. Now I can do both (and I don't know which way is preferable):
The presence of such a duality is an indicator of a design flaw, in the language (or SDK), I believe. |
@yegor256 maybe we can do the next:
Since |
@maxonfjvipon looks like a good solution |
…string-object fix(#3580): remove `bytes.as-string` object
Why do we need
bytes.as-string
if we can simply usestring
? The same question for all others: they exist inbytes
, but their functionality belongs to other objects, likenumber
,i64
, etc. I suggest deleting these methods.The text was updated successfully, but these errors were encountered: