src/pylib/builtins/iters

Source   Edit  

Some iterable in builtins

XXX: For JS backend: Currently due to Nim's inner buys, using of some iterable functions in this modules may result in Error: ...:

  • list(...)
  • filter/map/... as func (using iterator is okey) (solved after Nim-2.1.1)

For details, trace:

Procs

func enumerate[T](x: Iterable[T]; start = 0): Enumerate[T]
Source   Edit  
func filter[T](comp: NoneType; iter: Iterable[T]): Filter[T]
Source   Edit  
func filter[T](comp: proc (arg: T): bool; iter: Iterable[T]): Filter[T]
Source   Edit  
func map[T, R](function: proc (x: T): R; iterable: Iterable[T]): Map[T]
Source   Edit  
func reversed[T](x: Sequence[T]): Reversed[T]
Source   Edit  
func zip[A, B](it1: Iterable[A]; it2: Iterable[B]; strict: static[bool] = false): Zip[
    A]
Source   Edit  

Iterators

iterator enumerate[T](x: Iterable[T]; start = 0): (int, T)
Source   Edit  
iterator filter[T](comp: NoneType; iter: Iterable[T]): T
Source   Edit  
iterator filter[T](comp: proc (arg: T): bool; iter: Iterable[T]): T
Source   Edit  
iterator map[T, R](function: proc (x: T): R; iterable: Iterable[T]): R
Source   Edit  
iterator reversed[T](x: Sequence[T]): T
Source   Edit  
iterator zip[A, B](it1: Iterable[A]; it2: Iterable[B];
                   strict: static[bool] = false): (A, B)
Source   Edit  

Templates

template items(x: Enumerate): untyped
Source   Edit  
template items(x: Filter): untyped
Source   Edit  
template items(x: Map): untyped
Source   Edit  
template items(x: Reversed): untyped
Source   Edit  
template items(x: Zip): untyped
Source   Edit