From: Dave Thomas Date: 2008-08-06T09:43:22+09:00 Subject: [ruby-core:18136] Re: New array methods cycle, choice, shuffle (plus bug in cycle) On Aug 5, 2008, at 6:23 PM, Charles Oliver Nutter wrote: > I find I frequently need to get only the second element of an array, > or perhaps the seventh. So perhaps if we have choice/pick/sample > then we should implement "second" through "tenth" as well. Maybe > also powers of ten beyond that... "tenth", "twentieth", "thirtieth". > Maybe also every_other, every_third, every_fourth so I can dice my > arrays without wearing _why's flip-flops. Indeed. It would also be useful to implement state machine semantics on array fetches, where I could feed an event into an index and it returns the next index in the sequence. This would make arrays Turing Complete, and we could then dispense with the rest of Ruby, considerably reducing the size of the API. Dave