sawa wrote:
What is this issue? Is it just a note to everyone, or are you
claiming this to be a bug, or is it a feature request?
I think it could only possibly be a feature request since it
is not a bug. But you are uite right that it is difficult to
infer from the issue description alone.
To the topic itself: I can see some points, in particular with
hashes being ordered, where you could use .first and .last
similar as how could be done to Array. I once wondered whether
we should also have .second, .third and so forth, but one
problem I had with that is that this becomes less and less
likely to use; for example, if you have a large array of
array, how often would you use .eight (or [7]) for that
matter? Probably not that often. I do however have found
.second and .third in use now and then.
Of course we can use [] instead anyway, but the code layout
was sometimes strange. Such as in:
first_element = array[0]
last_element = array[-1]
second_element = array[1]
versus
first_element = array.first
last_element = array.last
second_element = array[1] # <- this one looks a bit weird if used with .first and .last
However had, I think I have not created an issue request. I assume
there may have been reasons why we do not have .second or
similar by default.
Note that the name BidirectionalEnumerable is quite weird too. This
is how we may end up with things such as HashWithIndifferentAccess.
That's an even stranger name ... ;)
Sorry for digressing. May have to see when zw963 can reply and clarify.