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 8892617D4134 for ; Sun, 10 Nov 2013 05:44:11 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id F2912B5D82B for ; Sun, 10 Nov 2013 05:12:57 +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 70E0E97A83A for ; Sun, 10 Nov 2013 05:12:58 +0900 (JST) X-Virus-Scanned: amavisd-new at nagaokaut.ac.jp 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 xu6psjVKT7jh for ; Sun, 10 Nov 2013 05:12:58 +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 367DD97A826 for ; Sun, 10 Nov 2013 05:12:58 +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 9B67E95241E for ; Sun, 10 Nov 2013 05:12:57 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id A87F3120577; Sun, 10 Nov 2013 05:12:54 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from fluorine.ruby-lang.org (fluorine.ruby-lang.org [210.251.121.216]) by neon.ruby-lang.org (Postfix) with ESMTP id 15A51120451 for ; Sun, 10 Nov 2013 05:12:52 +0900 (JST) Received: from ruby-lang.org (localhost [127.0.0.1]) by fluorine.ruby-lang.org (Postfix) with ESMTP id F0B8E29341 for ; Sun, 10 Nov 2013 05:12:51 +0900 (JST) Date: Sun, 10 Nov 2013 05:12:51 +0900 From: "baweaver (Brandon Weaver)" To: ruby-core@ruby-lang.org Message-Id: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Redmine-Issue-Author: duckinator X-Redmine-Issue-Assignee: matz X-Auto-Response-Suppress: OOF X-Redmine-Issue-Id: 6727 X-Redmine-Mailinglistintegration-Message-Ids: 31929 X-Mailer: Redmine X-Redmine-Project: ruby-trunk Auto-Submitted: auto-generated X-Redmine-Site: Ruby Issue Tracking System X-Redmine-Host: bugs.ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 58239 Subject: [ruby-core:58239] [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" 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: (()) Patch: (()) Diff: (()) =end -- http://bugs.ruby-lang.org/