-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
stdlib: Array.rotate rotates opposite to List.rotate #1470
Comments
Since immutable arrays (#1477) make use of left-rotation like |
Yes. Left rotation for all. Ruby's doc for it makes it feel really intuitive:
|
ospencer
pushed a commit
that referenced
this issue
Jan 10, 2023
marcusroberts
pushed a commit
that referenced
this issue
Jan 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@alex-snezhko noticed that
Array.rotate
andList.rotate
rotate in opposite directions with.Array.rotate
- Rotating to the right.and
List.rotate
- Rotating to the left.While you are able to rotate the other direction by using negative indexes, The behaviour seems random from a user perspective and could cause confusion.
The text was updated successfully, but these errors were encountered: