[Up] [Previous] [Next] [Index]

# 8.2 Iterators

- `CartesianIterator(` tuplelist`) O`

  Returns an iterator for `Cartesian(`tuplelist`)`

- `ConcatenationOfIterators(` iterlist`) F`

  `ConcatenationOfIterators(`iterlist`)` returns an iterator which runs through all iterators in iterlist. Note that the returned iterator loops over the iterators in iterlist sequentially beginning with the first one.

      gap> it:=Iterator([1,2,3]);;
      gap> it2:=CartesianIterator([[9,10],[11]]);;
      gap> cit:=ConcatenationOfIterators([it,it2]);;
      gap> repeat
      > Print(NextIterator(cit),",\c");
      > until IsDoneIterator(cit);
      1,2,3,[ 9, 11 ],[ 10, 11 ],

  [Up] [Previous] [Next] [Index]