1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
[1X2 [33X[0;0YPrinting Lists and Iterators[133X[101X
[1X2.1 [33X[0;0YPrinting selected items[133X[101X
[33X[0;0YThe functions described here print lists or objects with an iterator with
one item per line, either the whole list/iterator or certain subsets:[133X
[30X [33X[0;6Yby giving a list of positions of items to be printed, or[133X
[30X [33X[0;6Yby specifying a first item and then a regular step.[133X
[1X2.1-1 PrintSelection[101X
[33X[1;0Y[29X[2XPrintSelection[102X( [3Xobj[103X, [3Xlist[103X ) [32X function[133X
[33X[1;0Y[29X[2XPrintSelection[102X( [3Xobj[103X, [3Xfirst[103X, [3Xstep[103X[, [3Xlast[103X] ) [32X function[133X
[33X[0;0YThis function, given three (or four) parameters, calls operations
[10XPrintSelectionFromList[110X or [10XPrintSelectionFromIterator[110X which prints the [13Xfirst[113X
item specified, and then the item at every [13Xstep[113X. The fourth parameter is
essential when the object being printed is infinite.[133X
[33X[0;0YAlternatively, given two parameters, with the second parameter a list [10XL[110X of
positive integers, only the items at positions in [10XL[110X are printed.[133X
[4X[32X Example [32X[104X
[4X[28X[128X[104X
[4X[25Xgap>[125X [27XL := List( [1..20], n -> n^5 );;[127X[104X
[4X[25Xgap>[125X [27XPrintSelection( L, [18..20] );[127X[104X
[4X[28X18 : 1889568[128X[104X
[4X[28X19 : 2476099[128X[104X
[4X[28X20 : 3200000[128X[104X
[4X[25Xgap>[125X [27XPrintSelection( L, 2, 9 ); [127X[104X
[4X[28X2 : 32[128X[104X
[4X[28X11 : 161051[128X[104X
[4X[28X20 : 3200000[128X[104X
[4X[25Xgap>[125X [27XPrintSelection( L, 2, 3, 11 );[127X[104X
[4X[28X2 : 32[128X[104X
[4X[28X5 : 3125[128X[104X
[4X[28X8 : 32768[128X[104X
[4X[28X11 : 161051[128X[104X
[4X[25Xgap>[125X [27Xs5 := SymmetricGroup( 5 );;[127X[104X
[4X[25Xgap>[125X [27XPrintSelection( s5, [30,31,100,101] );[127X[104X
[4X[28X30 : (1,5)(3,4)[128X[104X
[4X[28X31 : (1,5,2)[128X[104X
[4X[28X100 : (1,4,3)[128X[104X
[4X[28X101 : (1,4)(3,5)[128X[104X
[4X[25Xgap>[125X [27XPrintSelection( s5, 1, 30 );[127X[104X
[4X[28X1 : ()[128X[104X
[4X[28X31 : (1,5,2)[128X[104X
[4X[28X61 : (1,2,3)[128X[104X
[4X[28X91 : (1,3,5,2,4)[128X[104X
[4X[25Xgap>[125X [27XPrintSelection( s5, 9, 11, 43 );[127X[104X
[4X[28X9 : (2,5,3)[128X[104X
[4X[28X20 : (2,4)[128X[104X
[4X[28X31 : (1,5,2)[128X[104X
[4X[28X42 : (1,5,2,3,4)[128X[104X
[4X[28X[128X[104X
[4X[32X[104X
|