-- -*- M2-comint -*- hash: 10821714916539586443

i1 : iter = iterator {1, 2, 3}

o1 = iter

o1 : Iterator

i2 : code iter

o2 = ../../m2/iterators.m2:22:4-27:15: --source code:
         () -> (
             if i >= #x then StopIteration
             else (
                 r := x#i;
                 i += 1;
                 r)))
     | symbol  class  value      location of symbol
     | ------  -----  -----      ------------------               
     | i       ZZ     0          ../../m2/iterators.m2:21:4-21:5  
     | x       List   {1, 2, 3}  ../../m2/iterators.m2:20:24-20:25

i3 : next iter

o3 = 1

i4 : iter()

o4 = 2

i5 : next iter

o5 = 3

i6 : iter()

o6 = StopIteration

o6 : Symbol

i7 : primes = Iterator (
         p := 2;
         () -> (
             r := p;
             p = nextPrime(p + 1);
             r));

i8 : iterator primes === primes

o8 = true

i9 : for p in primes list if p > 20 then break else p

o9 = {2, 3, 5, 7, 11, 13, 17, 19}

o9 : List

i10 : for p in primes list if p > 20 then break else p

o10 = {}

o10 : List

i11 : s = "Hello, world!"

o11 = Hello, world!

i12 : for c in s list c

o12 = {H, e, l, l, o, ,,  , w, o, r, l, d, !}

o12 : List

i13 : for c in s list c

o13 = {H, e, l, l, o, ,,  , w, o, r, l, d, !}

o13 : List

i14 : 
