Are there ruby equivalents to the lisp car, cdr, and cons functions? For those unfamiliar with lisp, here\'s what I want from ruby:
[1,2,3].car => 1 [1,2,3]
Ruby arrays are not implemented as singly-linked lists, so it is not as useful to have car and cdr and stuff.
If you really wanted, you could do
[1,2,3][0] => 1 [1,2,3].first => 1 [1,2,3][1..-1] => [2,3] [1] + [2,3] => [1,2,3]