-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add proc toOpenArray[byte] for strings #7820
Conversation
So user should use first argument as an uint instead of int because there's no result type overloading? It seems like not the best solution, but idk.. |
Yes.
Maybe |
Yeah... |
Renamed. |
Ok, now the question is: Why do we need it? |
E.g. for compressions/conversions. proc compress/convert(bytes: openarray[byte]): seq[byte] = Maybe can be used in the critbits module. |
For crypto |
And would be great if |
Also many procs from strutils can be adapted for |
This fails for the
The line that raises the issue:
|
Well, closed. |
@data-man why? |
Maybe it can be fixed |
@Yardanico Because @Araq are against it. :) |
@data-man we shouldn't be getting gen errors in Nim, so this is a valid bug that has been caught by your PR. As others mention, it could well be useful for various low level processing. |
It turned out that we need this in quite a lot of places. @Araq, any chance that we'll reconsider merging it? |
This doesn't need to rely on magic, openarrays can be constructed from ptr/len and produce good codegen. We might add |
Ok. |
No description provided.