G
Georgy
| first / rest is symmetric...
| head / tail unix commands don't default to 1 "line"
| car + cdr have crappy names.
| i'm sure there is something better for this
Could be take / drop (with optional argument, number of items):
[1,2,3,4].take --> 1
[1,2,3,4].take(1) --> 1 # or can be [1]
[1,2,3,4].take(2) --> [1,2]
[1,2,3,4].drop --> [2,3,4]
[1,2,3,4].drop(2) --> [3,4]
[1,2,3,4].take(-3) --> [2,3,4]
[1,2,3,4].drop(-1) --> [1,2,3]
And in some language there was a pair 'first / butfirst'.
| head / tail unix commands don't default to 1 "line"
| car + cdr have crappy names.
| i'm sure there is something better for this
Could be take / drop (with optional argument, number of items):
[1,2,3,4].take --> 1
[1,2,3,4].take(1) --> 1 # or can be [1]
[1,2,3,4].take(2) --> [1,2]
[1,2,3,4].drop --> [2,3,4]
[1,2,3,4].drop(2) --> [3,4]
[1,2,3,4].take(-3) --> [2,3,4]
[1,2,3,4].drop(-1) --> [1,2,3]
And in some language there was a pair 'first / butfirst'.