From: "A. S. Bradbury" Date: 2006-09-10T23:13:43+09:00 Subject: Re: How about Enumerable#find_pattern? On Sunday 10 September 2006 15:04, Robert Dober wrote: > class Array > def pattern( *args ) > l = args.length > c = dup > while c.first(l) != c do > c.shift > return nil if c.length < l > end > length - c.length > end > end That is one possible implementation, and this isn't something I'm having a problem implementing. I'm just asking whether it would be appropriate for there to be a pattern matcher for Enumerable objects in core implemented using an efficient algorithm such as Knuth-Morris-Pratt. To me it just seems useful to be able to efficiently search Enumerable objects without having to implement it myself. It's a very small addition that just makes Enumerable objects that much more useful. Alex