From: Thiago Massa Date: 2013-11-13T10:45:44-02:00 Subject: [ruby-core:58310] Re: [CommonRuby - Feature #9023] Array#tail --089e013a1e7afc64ec04eb0e57e4 Content-Type: text/plain; charset=ISO-8859-1 rest sounds definitely better. Clojure uses it and it feels very natural and readable. On Wed, Nov 13, 2013 at 7:59 AM, bozhidar (Bozhidar Batsov) < bozhidar@batsov.com> wrote: > > Issue #9023 has been updated by bozhidar (Bozhidar Batsov). > > > I also dislike the name Array#tail, since it's commonly associated with > linked lists, not arrays. I think a much better name would be > Array#butfirst (and I've actually renamed Array#tail in powerpack to > Array#butfirst). On a related note it makes sense to have a method > Array#butlast as well - it should obviously everything except the last > element of the array. > ---------------------------------------- > Feature #9023: Array#tail > https://bugs.ruby-lang.org/issues/9023#change-42901 > > Author: fuadksd (Fuad Saud) > Status: Assigned > Priority: Normal > Assignee: matz (Yukihiro Matsumoto) > Category: > Target version: > > > I propose the addition of a `tail` method to the Array class that returns > all elements but the first. It is a pretty common pattern in functional > programming, but not limited to - I use it extensively in all kinds of > apps/gems. The implementation would be pretty trivial, I won't risk a patch > to MRI because I'm uninitiated on ruby core matters, but powerpack gem ( > http://github.com/bbatsov/powerpack) implements it in ruby in terms of > slices. > > > > -- > http://bugs.ruby-lang.org/ > --089e013a1e7afc64ec04eb0e57e4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
rest sounds definitely better. Clojure uses it and it feel= s very natural and readable.


On Wed, Nov 13, 2013 at 7:59 AM, bozhidar (Bozhidar Ba= tsov) <bozhidar@batsov.com> wrote:

Issue #9023 has been updated by bozhidar (Bozhidar Batsov).


I also dislike the name Array#tail, since it's commonly associated with= linked lists, not arrays. I think a much better name would be Array#butfir= st (and I've actually renamed Array#tail in powerpack to Array#butfirst= ). On a related note it makes sense to have a method Array#butlast as well = - it should obviously everything except the last element of the array.
----------------------------------------
Feature #9023: Array#tail
https://bugs.ruby-lang.org/issues/9023#change-42901

Author: fuadksd (Fuad Saud)
Status: Assigned
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category:
Target version:


I propose the addition of a `tail` method to the Array class that returns a= ll elements but the first. It is a pretty common pattern in functional prog= ramming, but not limited to - I use it extensively in all kinds of apps/gem= s. The implementation would be pretty trivial, I won't risk a patch to = MRI because I'm uninitiated on ruby core matters, but powerpack gem (http://gith= ub.com/bbatsov/powerpack) implements it in ruby in terms of slices.



--
http://bugs.ruby-l= ang.org/

--089e013a1e7afc64ec04eb0e57e4--