-
-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Argument labels for bit_array.slice and string.slice are inconsistent #555
Comments
This could be upgraded with optional args, but without them, this is a breaking change. |
What should we make them? |
Personally I like the Now I noticed the return type is different too, that's unfortunate :( |
Also, |
It's not possible as you can't negatively traverse a string, graphemes are not of constant size. |
Thanks for the input @lpil . I think my reply might have been a bit confusing (sorry!), so just to clarify: I meant being able to pass a negative number to the "position" argument in bit_array.slice for convenience, so slicing at a position of -4 with a length of 4 would give you the 4 last bytes, for example. Mostly because string.slice seems to allow that. Does this sound like a good idea, or should users just use byte_size(bit array) anyway? |
Oh! If strings support it then we should support it for bit arrays too |
It would be nice if they had the same labels. I tried looking for more functions like that, but I didn't find anything else.
The text was updated successfully, but these errors were encountered: