From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 5D51C17D4134 for ; Sun, 10 Nov 2013 06:10:04 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (smtp.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 04ECFB5D825 for ; Sun, 10 Nov 2013 05:38:51 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 8556E97A834 for ; Sun, 10 Nov 2013 05:38:51 +0900 (JST) X-Virus-Scanned: amavisd-new at nagaokaut.ac.jp Authentication-Results: funfun.nagaokaut.ac.jp (amavisd-new); dkim=fail (2048-bit key) reason="fail (message has been altered)" header.d=gmail.com Received: from funfun.nagaokaut.ac.jp ([127.0.0.1]) by funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I8XCgK3E0fzF for ; Sun, 10 Nov 2013 05:38:51 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 5207097A826 for ; Sun, 10 Nov 2013 05:38:51 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id C07E695241B for ; Sun, 10 Nov 2013 05:38:50 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id CA803120DA5; Sun, 10 Nov 2013 05:38:47 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from mail-ea0-f173.google.com (mail-ea0-f173.google.com [209.85.215.173]) by neon.ruby-lang.org (Postfix) with ESMTPS id 1787E1205D0 for ; Sun, 10 Nov 2013 05:38:40 +0900 (JST) Received: by mail-ea0-f173.google.com with SMTP id g10so1837763eak.4 for ; Sat, 09 Nov 2013 12:38:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=MULhrw+GtoClTau21QnwlR8qBtXCpZ2kpI2CwtQN+es=; b=nn9nnxizvhRD2s39vbxfDX9/OEi7eUHhr/r6D/OWc1vV1O8q7jzFaPzPsoSpHrA2Za htyuWJHTpPOUK2jVdhfzyMjb6NtZBumYrBJlWAvVSLhwhp5Yr5RLGaQ0yiU1Pf7OhcYW ycnz7RkOu5CoAkz4xNA7foLHzL+L1EzkoqKSKeO9pZTiHAOOQdgkMf2vcrm8cp7TPV5y Bsv3gDS1Wht5EtQ1t8RGTNJzRhBI3KU3RWRxL7rEvpfWGRbj2CY3UmIIY6Ld54mKB+sL GfUDOETcBS9RtydUVtPC3xCWWHyfA0jogDaNCJmwrB7G7KIJfx0BtjScKMoofedtd8Rc W7Tw== MIME-Version: 1.0 X-Received: by 10.14.216.136 with SMTP id g8mr443026eep.61.1384029517037; Sat, 09 Nov 2013 12:38:37 -0800 (PST) Received: by 10.223.133.71 with HTTP; Sat, 9 Nov 2013 12:38:36 -0800 (PST) Received: by 10.223.133.71 with HTTP; Sat, 9 Nov 2013 12:38:36 -0800 (PST) In-Reply-To: References: Date: Sat, 9 Nov 2013 18:38:36 -0200 Message-ID: From: Fuad Saud To: Ruby developers Content-Type: multipart/alternative; boundary=047d7b603d1cb8c67104eac47b12 X-ML-Name: ruby-core X-Mail-Count: 58240 Subject: [ruby-core:58240] Re: [ruby-trunk - Feature #6727] Add Array#rest (with implementation) X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" --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--