-
Notifications
You must be signed in to change notification settings - Fork 28
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
Feature request: reverse method #13
Comments
This is achieved by the bracket method: |
Yes, I found out. I was still surprised that there wasn't a reverse method. Ruby is about keeping surprises to a minimum, yes? |
I can see the natural behaviour of reverse method for one-dimensional array. But I havent found what a.reverse shoud return if a is a multi-dimensinal array. |
I like the convenience of a reverse method. How about:
On a one-dimensional array:
Two-dimensional array:
And of course this principle works fine on higher dimensional arrays as well. |
or
? |
How about:
Without argument, all dimensions are reversed:
If an index/dimension is specified, only the specified dimension gets reversed.
Reversing columns:
|
Can we please have a reverse method that efficiently reverses the order of elements inline.
Cheers,
Martin
The text was updated successfully, but these errors were encountered: