From: Mathieu Bouchard Date: 2001-03-14T06:53:54+09:00 Subject: [ruby-talk:12583] Re: ...and the challenge On Mon, 12 Mar 2001, Robert Feldt wrote: > Thanks for all nice solutions, this was fun. > My solution is slower than yours but shorter when you've got > LazyArray's (It's simple to define them if you build on > MetaRuby; they're basically as the ProcAsArray example but allowing a > length of Infinity): Well, ProcAsArray doesn't cache anything, so you added that as well. Btw, the contract for ArrayInterface requires #length to return a nonnegative Integer. If I were to change that (to include Floats or even just Infinity) I possibly would have to rescan ArrayMixin's whole source code... and many operations wouldn't make sense anymore anyway... etc. matju