From: "yhara (Yutaka HARA)" Date: 2012-10-25T17:48:28+09:00 Subject: [ruby-core:48242] [ruby-trunk - Feature #6240] Enumerable#drop with negative argument Issue #6240 has been updated by yhara (Yutaka HARA). Target version changed from 2.0.0 to next minor ---------------------------------------- Feature #6240: Enumerable#drop with negative argument https://bugs.ruby-lang.org/issues/6240#change-31517 Author: marcandre (Marc-Andre Lafortune) Status: Assigned Priority: Normal Assignee: matz (Yukihiro Matsumoto) Category: core Target version: next minor 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/