(cross-posted from the dev list)
Been thinking about this, and I think I now agree with Dierk
For CharSequence, Array, List and Map, the function names take and drop don't seem right, as the original object is not (and shouldn't be) mutated, so
def a = 'tim'
println a.take( 1 )
will print t and the variable a will still be set to 'tim'
in these situations, I believe the methods should be called first and last
However, for Iterator, Reader and InputStream where the state of the object is changed by reading elements, I believe that take fits, so
def a = new StringReader('tim')
will print t, and the variable a will now be the Reader containing the remaining String 'im'
drop would (in these three cases) exhaust the input, so there would be nothing left in the Iterator, Reader or InputStream if it were interrogated again.
So in summary, my suggestion is:
CharSequence, Array, List and Map : first(n) and last(n)
Iterator, Reader and InputStream : take(n) and drop(n)