| ↑ Up |
Functions that create iterators.
iter(iterables.sum(list)).
> chain(1..2,1..4).list() [1, 2, 1, 2, 3, 4]
a.
x over and over
again. If n is given, the iterator will be exhausted
after n calls.
Functional programming.
fib = fix(|f,n| 1 if n==1 or n==2 else f(n-1)+f(n-2))
x is done by x.value().
The expression is evaluated only once, the result then memoized for
subsequent calls.