def counter(low, high, step) Enumerator.new do |enum| current = low while current <= high enum.yield current current += step end endendfor c in counter(3, 9, 2) do print(c, ", ")end# printed 3, 5, 7, 9,