From: Fuad Saud Date: 2013-11-09T18:38:36-02:00 Subject: [ruby-core:58240] Re: [ruby-trunk - Feature #6727] Add Array#rest (with implementation) --047d7b603d1cb8c67104eac47b12 Content-Type: text/plain; charset=ISO-8859-1 I proposed it as well in #9023 in the CommonRuby list. I don't think the arguments given there are enough to justify not implementing such an useful method. On Nov 9, 2013 6:13 PM, "baweaver (Brandon Weaver)" < brandon_weaver@baweaver.com> wrote: > > Issue #6727 has been updated by baweaver (Brandon Weaver). > > > As this seems to have been either dead-ended or otherwise, I'd like to > bring it back up. > > Most of the arguments I head as to why not to include a rest or tail > method is that Ruby is not Lisp, or that there's a hack-around method that > works the same way. The two objections I have to such reasoning are that > Matz himself designed Ruby in part after Lisp, and that the point of Ruby > is to be succinct and clear. > > I strongly believe that array.rest or array.tail are clearer than > array[1..-10] or rest = array.drop. The point is to be clear and concise, > and this clearly aims to improve upon such. > > As per the usefulness of such a construct, tail-recursion and functional > constructs come heavily to mind. > > Within the last year I would have made an argument that lambda was not > needed in the language because I had not tried to use it, and I have been > heavily proven wrong in that thinking. A C programmer may think closures > are useless because they have never used one in production. You use the > tools you are given, and in some cases become biased towards them. > > That being said, we could also add car and cdr just for warm fuzzy > feelings while we're at it ;) > ---------------------------------------- > Feature #6727: Add Array#rest (with implementation) > https://bugs.ruby-lang.org/issues/6727#change-42829 > > Author: duckinator (Nick Markwell) > Status: Assigned > Priority: Normal > Assignee: matz (Yukihiro Matsumoto) > Category: core > Target version: next minor > > > =begin > I run into many instances where I end up using (({arr[1..-1]})), so I > decided to add (({arr.rest})) to make that a bit less hideous. > > Branch on github: (( https://github.com/duckinator/ruby/compare/feature/array_rest>)) > > Patch: (( https://github.com/duckinator/ruby/compare/feature/array_rest.patch>)) > > Diff: (( https://github.com/duckinator/ruby/compare/feature/array_rest.diff>)) > =end > > > -- > http://bugs.ruby-lang.org/ > --047d7b603d1cb8c67104eac47b12 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

I proposed it as well in #9023 in the CommonRuby list. I don't think= the arguments given there are enough to justify not implementing such an u= seful method.

On Nov 9, 2013 6:13 PM, "baweaver (Brandon = Weaver)" <brandon_we= aver@baweaver.com> wrote:

Issue #6727 has been updated by baweaver (Brandon Weaver).


As this seems to have been either dead-ended or otherwise, I'd like to = bring it back up.

Most of the arguments I head as to why not to include a rest or tail method= is that Ruby is not Lisp, or that there's a hack-around method that wo= rks the same way. The two objections I have to such reasoning are that Matz= himself designed Ruby in part after Lisp, and that the point of Ruby is to= be succinct and clear.

I strongly believe that array.rest or array.tail are clearer than array[1..= -10] or rest =3D array.drop. The point is to be clear and concise, and this= clearly aims to improve upon such.

As per the usefulness of such a construct, tail-recursion and functional co= nstructs come heavily to mind.

Within the last year I would have made an argument that lambda was not need= ed in the language because I had not tried to use it, and I have been heavi= ly proven wrong in that thinking. A C programmer may think closures are use= less because they have never used one in production. You use the tools you = are given, and in some cases become biased towards them.

That being said, we could also add car and cdr just for warm fuzzy feelings= while we're at it ;)
----------------------------------------
Feature #6727: Add Array#rest (with implementation)
https://bugs.ruby-lang.org/issues/6727#change-42829

Author: duckinator (Nick Markwell)
Status: Assigned
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: next minor


=3Dbegin
I run into many instances where I end up using (({arr[1..-1]})), so I decid= ed to add (({arr.rest})) to make that a bit less hideous.

Branch on github: ((<URL:https://github.com/duckinator/= ruby/compare/feature/array_rest>))

Patch: ((<URL:https://github.com/duckinator/ruby/= compare/feature/array_rest.patch>))

Diff: ((<URL:https://github.com/duckinator/ruby/co= mpare/feature/array_rest.diff>))
=3Dend


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