lib/sixarm_ruby_ramp/enumerable/each.rb
# Implement #each_at by using a strategy with no optimization.
#
# When #each_at tests that either self#at is unavailable or filter#each
# is unavailable, then #each_at calls this strategy.
#
# This strategy uses a loop counter and iteration on the self elements,
# and each iteration, test whether the counter is in the filter.
#
# This strategy is the slowest, and for the worst-case need.
# This strategy is rarely needed in the wild.
#
Implement #each_at by using a strategy with no optimization.
When #each_at tests that either self#at is unavailable or filter#each
is unavailable, then #each_at calls this strategy.

This strategy uses a loop counter and iteration on the self elements,
and each iteration, test whether the counter is in the filter.

This strategy is the slowest, and for the worst-case need.
This strategy is rarely needed in the wild.
Implement #each_at by using a strategy with no optimization . When #each_at tests that either self#at is unavailable or filter#each is unavailable then #each_at calls this strategy . This strategy uses a loop counter and iteration on the self elements and each iteration test whether the counter is in the filter . This strategy is the slowest and for the worst - case need . This strategy is rarely needed in the wild .
def each_at_strategy_with_optimization_off(filter)
    i = 0
    if respond_to?(:size)
      each{|e|
        yield(e) if (filter.include?(i) || (size && filter.include?(i - size)))
        i += 1
      }
    else
      each{|e|
        yield(e) if (filter.include?(i))
        i += 1
      }
    end
  end
def each_at_strategy_with_optimization_off ( filter ) i = 0 if respond_to? ( :size ) each { | e | yield ( e ) if ( filter . include? ( i ) || ( size && filter . include? ( i - size ) ) ) i += 1 } else each { | e | yield ( e ) if ( filter . include? ( i ) ) i += 1 } end end
Implement #each_at by using a strategy with no optimization.
Implement #each_at by using a strategy with no optimization .
filter