Issue #13118 has been updated by Shyouhei Urabe.
Status changed from Open to Closed
No problem. Thank you anyway.
----------------------------------------
Feature #13118: Array#at(*indexes); Array#at([indexes])
https://bugs.ruby-lang.org/issues/13118#change-62448
* Author: Chad Brewbaker
* Status: Closed
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
It is useful to have Array return a repeated permutation. Rather than add another method, we could overload Array#at to take multiple indexes.
~~~ruby
a = [ "a", "b", "c", "d", "e" ]
a.at(0) #=> "a"
a.at(-1) #=> "e"
#New stuff
a.at(0,1) #=> ["a", "b"]
a.at(0,0) #=> ["a", "a")
a.at([2,3]) #=> ["c", "d"]
a.at([-1,1]) #=> ["e", "b"]
~~~
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>