[#57574] [ruby-trunk - Feature #8976][Open] file-scope freeze_string directive — "akr (Akira Tanaka)" <akr@...>

70 messages 2013/10/02

[#57579] [ruby-trunk - Feature #8977][Open] String#frozen that takes advantage of the deduping — "sam.saffron (Sam Saffron)" <sam.saffron@...>

25 messages 2013/10/02

[#57679] [ruby-trunk - Feature #8987][Open] map/collect extension which handles arguments — "sowieso (So Wieso)" <sowieso@...>

16 messages 2013/10/05

[#57705] [ruby-trunk - Feature #8992][Open] Use String#freeze and compiler tricks to replace "str"f suffix — "headius (Charles Nutter)" <headius@...>

43 messages 2013/10/07

[#57727] [ruby-trunk - Feature #8998][Open] string keys for hash literals should use fstrings — "normalperson (Eric Wong)" <normalperson@...>

17 messages 2013/10/08

[#57771] [ruby-trunk - Bug #9008][Open] TestProcess#test_clock_getres_constants and TestProcess#test_clock_gettime_constants fails on ARM — "vo.x (Vit Ondruch)" <v.ondruch@...>

15 messages 2013/10/09

[#57888] [ruby-trunk - Feature #9025][Open] Clarify the error message when calling a method with the wrong number of arguments — Nerian (Gonzalo Rodríguez) <siotopo@...>

11 messages 2013/10/15

[#57993] [ruby-trunk - Feature #9047][Open] Alternate hash key syntax for symbols — "jamonholmgren (Jamon Holmgren)" <jamon@...>

13 messages 2013/10/23

[#58007] [ruby-trunk - Feature #9049][Open] Shorthands (a:b, *) for inclusive indexing — "mohawkjohn (John Woods)" <john.o.woods@...>

25 messages 2013/10/24

[#58033] [ruby-trunk - Bug #9053][Open] SSL Issue with Ruby 2.0.0 — "tisba (Sebastian Cohnen)" <ruby-lang@...>

16 messages 2013/10/25

[#58080] [ruby-trunk - Feature #9064][Open] Add support for packages, like in Java — "rosenfeld (Rodrigo Rosenfeld Rosas)" <rr.rosas@...>

23 messages 2013/10/30

[ruby-core:57873] [CommonRuby - Feature #9023][Assigned] Array#tail

From: "mame (Yusuke Endoh)" <mame@...>
Date: 2013-10-15 12:37:49 UTC
List: ruby-core #57873
Issue #9023 has been updated by mame (Yusuke Endoh).

Status changed from Open to Assigned
Assignee set to matz (Yukihiro Matsumoto)

FYI:

I made the same proposal in Japanese [ruby-dev:32198].  But matz did not agree with me because "tail" did not look a good name to him.  Indeed, it is unnatural that all but "head" is "tail", especially, for those who are not familiar with typed functional programming such as ML and Haskell.

Even for very functional people.
http://wadler.blogspot.jp/2009/11/list-is-odd-creature.html

Matz counter-proposed "butfirst" (which comes from LOGO) but received many negative comments, he said.  The following names were suggested but matz did not like all of them.

  - cdr
  - rest
  - body
  - tail
  - subseq
  - headless
  - follower
  - but_first
  - subsequence
  - from_second
  - continuation
  - second_or_later

In the end, knu suggested a simple workaround:

  ary.drop(1)

-- 
Yusuke Endoh <mame@tsg.ne.jp>
----------------------------------------
Feature #9023: Array#tail
https://bugs.ruby-lang.org/issues/9023#change-42469

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/

In This Thread