Closed 64kramsystem closed 6 years ago
@st0012 updated the title/description.
Returning the descending values looks good to me:
» (5..1).to_a
#» [5, 4, 3, 2, 1]
According to Ruby's behavior I think we should raise an error, since they are actually un-functional and returns unexpected result (at least for me (1..5).to_a
shouldn't return an empty array).
But descending value also works for me.
@ear7h Can you work on this? We want descending ranges work in Ruby, let's start from making the to_a
method returns right array:
» (5..1).to_a
#» [5, 4, 3, 2, 1]
In Goby, descending ranges return the values in ascending orders (in Ruby, the don't return values):
Goby:
Ruby:
I think that either they should work likey Ruby, or, they should returns descending values: