iyi

Standard library, 0.18.0

std/steppable

import std/steppable to use it. Source: src/std/steppable.iyi at v0.18.0.

NumericStepIterator(T)class

Implements a step method for iterating from a value. T needs +, -, <=>, and comparison with the integer 0 (> / <).

std/steppableiyi doc src/std/steppable.iyi
pub class NumericStepIterator(T)
  def initialize(current : T, limit : T | ::Nil, step : T, exclusive : ::Bool)
  def next : T | Stop
  def sum(initial : U) : U forall U
end

Steppabletrait

std/steppableiyi doc src/std/steppable.iyi
pub trait Steppable
  # Iterates from self to limit incrementing by step_val on each iteration.
  def step(*, to limit : self | ::Nil = nil, by step_val : self, exclusive : ::Bool = false, & : (self -> ::Nil)) : ::Nil
  # Returns an Iterator that iterates from self to limit by step_val.
  def step(*, to limit : self | ::Nil = nil, by step_val : self, exclusive : ::Bool = false) : NumericStepIterator(self)
end

Std::Iterator::Iterator for NumericStepIterator(T) forall Timpl

std/steppableiyi doc src/std/steppable.iyi
impl Std::Iterator::Iterator for NumericStepIterator(T) forall T
end

Steppable for Int32impl

std/steppableiyi doc src/std/steppable.iyi
impl Steppable for Int32
end

Steppable for Int64impl

std/steppableiyi doc src/std/steppable.iyi
impl Steppable for Int64
end

Steppable for Float64impl

std/steppableiyi doc src/std/steppable.iyi
impl Steppable for Float64
end