From: "marcandre (Marc-Andre Lafortune)" Date: 2012-04-01T05:57:41+09:00 Subject: [ruby-core:44028] [ruby-trunk - Feature #6240][Open] Enumerable#drop with negative argument Issue #6240 has been reported by marcandre (Marc-Andre Lafortune). ---------------------------------------- Feature #6240: Enumerable#drop with negative argument https://bugs.ruby-lang.org/issues/6240 Author: marcandre (Marc-Andre Lafortune) Status: Open Priority: Normal Assignee: Category: core Target version: 2.0.0 Currently, Enumerable#drop works only for non-negative arguments. It could be extended so that negative arguments means dropping from the end: [:hello, :world].drop(-1) # => [:hello] This could especially be interesting for `Lazy#drop`, which would keep a circular buffer of elements before yielding them. (1..6).lazy.drop(-3).each{|x| puts x} # -> prints 1, 2 and 3 Thoughts? -- http://bugs.ruby-lang.org/