On Aug 30, 2006, at 1:43 PM, Logan Capaldo wrote:

>
> On Aug 30, 2006, at 1:12 PM, ara.t.howard / noaa.gov wrote:
>
>>
>>
>>
>> harp:~ > cat a.rb
>> class Array
>>   def self.step i, *a, &b
>>     j, s, ignored = *a
>>     i, j = 0, i if j.nil?
>>     s ||= (j < i ? -1 : 1)
>>     list = new
>>     i.step(j,s){|k| list << k}
>>     list.map! &b if b
>>     list
>>   end
>> end
>>
>
Oops, minor addition follows:

> require 'enumerator'
> class Array
>   def self.step(i, *a, &block)
>     b = block || lambda { |x| x }
+    i, a[0] = 0, i if a.empty?
>     i.to_enum(:step, *a).map(&b)
>   end
> end
>
>


>