From: David Flanagan Date: 2007-10-30T13:41:39+09:00 Subject: new Enumerable.butfirst method Matz, You wrote in your recent changelog entry: * enum.c (enum_butfirst): add a new method to iterates over elements but first n. RDoc need to be updated. I'd be happy to update the rdoc comment, but it looks okay as it is to me. Did you just want an example added? Or something else? I should say, however, that I don't care for the name 'butfirst'. I've got three alternatives to propose: 1) How about 'skip' (or 'discard') instead, which would nicely support its use as an enumerator like this: c.skip(n).map {|x|...} # map all but the first n If you like this, I'd also propose 'only' (or 'limit'): c.only(n).map { |x| ...} # iterates no more than n elements from c 2) Another idea would be to be more verbose than 'butfirst': each_but_first, which is much clearer and is similar to the existing each_with_index. Then the opposite method would be each_but_only to iterate only the first n? 3) Is there some way to integrate your butfirst with the earlier added take and drop methods? If you removed the form of drop and take that accept a block, and modified them to be iterators instead of returning an array, then you'd end up with this butfirst, with a much more natural (in my opinion) name. Then you'd just have to come up with new names for the versions that use a block. Maybe take_while and drop_while? The "while" would indicate that the block supplies a condition. These would still have to return an enumerator instead of an array, but that seems more general and useful to me, anyway... David