Import std.core.iterator
std.core.iterator
What 'For ... In' goes over besides arrays. Each Next gives the next element, or Null when there are no more. The loop goes over a copy of a Struct, since its Next changes it.
Its adapters are lazy: each gives an Iterator of its own, which asks the one before it for a
value only when it's asked for one. Its consumers go over the values once. They're all Final,
so they're what every Iterator has, through its value too. Called on a Struct, they go over a
copy of it, and a Class's object is used up, as a For loop over it is. A @PanicsAtCaller Next
panics where a consumer is called, and through an adapter or a box, where its panic is, as
through any Iterator<T> value.
std/core/iterator.fb
Types
Iterator
interface
Public Interface Iterator<T>
What 'For ... In' goes over: each Next gives the next value, and its adapters and consumers work on the values that are left.
-
The next value, or Null when there are no more.
-
What
changegives for each value. -
The values
keepsays to keep. -
The first
countvalues, or all of them when there are fewer. -
The values after the first
count. -
The values before the first that
keepsays not to keep. -
The values from the first that
skipsays not to skip. -
Each value with how many came before it.
-
Each value with
other's at the same place, as far as the shorter goes. -
These values, then
other's. -
The values of each value, which is an
Iterable<U>, one after another. -
The first value, then each step-th one after it.
-
The values in arrays of
size, the last one shorter when they don't divide evenly. -
Each run of
sizevalues in a row, in an array of its own: none when there are fewer. -
The values, smallest
keyfirst, where equal keys keep their order. It goes over them all when it's first asked for one. -
The values, largest
keyfirst, where equal keys keep their order. -
The values, in a new array.
-
How many values there are.
-
Whether
testsays yes for any value, going no further than the first. -
Whether
testsays yes for every value, going no further than the first it doesn't. -
The first value
testsays yes for, or Null. -
The first value, or Null when there's none.
-
The last value, or Null when there's none.
-
What
combinemakes ofstartand each value in turn. -
What
combinemakes of the values, the first two, then that and the next, and so on: the first alone when there's one, and Null when there's none. -
Runs
actionfor each value. -
The values added up, or zero when there are none.
-
The values multiplied together, or one when there are none.
-
The smallest value, the first of equal ones, or Null when there's none.
-
The largest value, the first of equal ones, or Null when there's none.
-
The value whose key is smallest, the first of equal ones, or Null when there's none.
-
The value whose key is largest, the first of equal ones, or Null when there's none.
Iterable
interface
Public Interface Iterable<T>
What 'For ... In' goes over through its Iterate(), for code that takes any collection. A
collection's Iterate() gives a Struct of its own, which an Iterable<T>'s value or generic code
gets in a box, an Iterator<T> object.
std/core/iterator.fb, line 304
-
Its values, from the first, in an Iterator of their own.
Functions
Repeated
function
@PanicsAtCaller Public Function Repeated<T>(value: T, count: Int): Iterator<T>
value, count times.
Empty
function
Public Function Empty<T>(): Iterator<T>
No values.
Report an issue with this page or with FutureBlitz on GitHub.