List (and Array) is a snake : everything but head is tail :)


2013/10/18 Fuad Saud <fuadksd / gmail.com>

> I can understand maybe tail is not the best name to describe this concept,
> nor any of the other options. But it is still a pretty common idiom among
> many functional languages.
>
> I like cdr, but it wouldn't make much sense to introduce it in ruby today
> - it may confuse newcomers a lot, since that's not vey intuitive.
>
> Rest doesn't feel right. What is rest? It's a remainder, but if you drop
> the last element, then what remains is still a kind of rest :/
>
> Butfirst is weird for me, but bbatsov (powerpack maintainer) prefered it
> over tail, and it makes it very clear what it means (e.g.
> people.but_first.each do ... means iterate over people but the first).
>