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 387FA17C919F for ; Fri, 13 Jul 2012 15:03:58 +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 52064EA6CD5 for ; Fri, 13 Jul 2012 15:01:06 +0900 (JST) Received: from localhost (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id EC7208FC57 for ; Fri, 13 Jul 2012 15:01:06 +0900 (JST) X-Virus-Scanned: amavisd-new at funfun.nagaokaut.ac.jp Received: from funfun.nagaokaut.ac.jp ([127.0.0.1]) by localhost (funfun.nagaokaut.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CIxcecohAcYF for ; Fri, 13 Jul 2012 15:01:06 +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 CBFF98FC28 for ; Fri, 13 Jul 2012 15:01:06 +0900 (JST) Received: from carbon.ruby-lang.org (carbon.ruby-lang.org [221.186.184.68]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 730CB952420 for ; Fri, 13 Jul 2012 15:01:04 +0900 (JST) Received: from beryllium.ruby-lang.org (beryllium.ruby-lang.org [127.0.0.1]) by carbon.ruby-lang.org (Postfix) with ESMTP id BEB0C3C2277C5; Fri, 13 Jul 2012 15:01:02 +0900 (JST) Received: from fluorine.ruby-lang.org (www.rubyist.net [210.251.121.216]) by carbon.ruby-lang.org (Postfix) with ESMTP id 5EB9C3C21F121 for ; Fri, 13 Jul 2012 15:01:02 +0900 (JST) Received: from ruby-lang.org (localhost [127.0.0.1]) by fluorine.ruby-lang.org (Postfix) with ESMTP id 3D40D3ED5B for ; Fri, 13 Jul 2012 15:01:02 +0900 (JST) Delivered-To: ruby-core@ruby-lang.org Date: Fri, 13 Jul 2012 15:01:02 +0900 Posted: Fri, 13 Jul 2012 15:01:02 +0900 From: "tsion (Scott Olson)" Reply-To: ruby-core@ruby-lang.org Subject: [ruby-core:46384] [ruby-trunk - Feature #6727] Add Array#rest (with implementation) To: ruby-core@ruby-lang.org Message-Id: References: X-ML-Name: ruby-core X-Mail-Count: 46384 X-MLServer: fml [fml 4.0.3 release (20011202/4.0.3)]; post only (only members can post) X-ML-Info: If you have a question, send e-mail with the body "help" (without quotes) to the address ruby-core-ctl@ruby-lang.org; help= X-Mailer: Redmine X-Redmine-Issue-Author: duckinator X-Auto-Response-Suppress: OOF X-Redmine-Issue-Id: 6727 X-Redmine-Mailinglistintegration-Message-Ids: 16680 X-Redmine-Project: ruby-trunk Auto-Submitted: auto-generated X-Redmine-Site: Ruby Issue Tracking System X-Redmine-Host: bugs.ruby-lang.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Precedence: bulk List-Id: ruby-core.ruby-lang.org List-Software: fml [fml 4.0.3 release (20011202/4.0.3)] List-Post: List-Owner: List-Help: List-Unsubscribe: Issue #6727 has been updated by tsion (Scott Olson). I agree, I see and use ary[1..-1] quite a lot, and ary.rest would convey the meaning a lot better. And it isn't just the ugliness of the syntax of ary[1..-1] that makes it undesirable, there's also the fact that it is zero-based from the front end and one-based from the back end (I know this can't really be helped because 0 == -0, but it does make Array#rest more desirable). On top of that, I think #first and #rest make a nice pair, like head and tail from Haskell or any language with cons lists. ---------------------------------------- Feature #6727: Add Array#rest (with implementation) https://bugs.ruby-lang.org/issues/6727#change-28000 Author: duckinator (Nick Markwell) Status: Rejected Priority: Normal Assignee: Category: Target version: =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: (()) Patch: (()) Diff: (()) =end -- http://bugs.ruby-lang.org/