-- -*- M2-comint -*- hash: 150215688834485405

i1 : for i from 1 to 5 when i < 15 list i^2 do print i
1
2
3
4
5

o1 = {1, 4, 9, 16, 25}

o1 : List

i2 : for i from 1 to 5 when i^2 < 15 list i^2 do print i
1
2
3

o2 = {1, 4, 9}

o2 : List

i3 : for i from 1 to 3 do (
          print "The value of i is : ";
          print i
          )
The value of i is : 
1
The value of i is : 
2
The value of i is : 
3

i4 :      
     for i from 1 to 5 when i < 15 list i^2

o4 = {1, 4, 9, 16, 25}

o4 : List

i5 : for i to 5 when i < 15 list i^2

o5 = {0, 1, 4, 9, 16, 25}

o5 : List

i6 : for i to 5 list i^2

o6 = {0, 1, 4, 9, 16, 25}

o6 : List

i7 : for i when i < 15 list i^2

o7 = {0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196}

o7 : List

i8 : for i when i^2 < 15 do print i
0
1
2
3

i9 : for i from 0 when i < 10 list (if odd i then continue; i^2)

o9 = {0, 4, 16, 36, 64}

o9 : List

i10 : for i from 0 when i < 10 list (if odd i then continue 4567; i^2)

o10 = {0, 4567, 4, 4567, 16, 4567, 36, 4567, 64, 4567}

o10 : List

i11 : for i from 0 when i < 10 list (if i== 5 then break i; i^2)

o11 = 5

i12 : for i from 0 when i < 10 list (if i== 5 then break; i^2)

o12 = {0, 1, 4, 9, 16}

o12 : List

i13 : for i in 0..3 list i^2

o13 = {0, 1, 4, 9}

o13 : List

i14 : for i in "foo" do print i
f
o
o

i15 : 
