The functions described here print lists or objects with an iterator
with one item per line, either the whole list/iterator or certain subsets:
<List>
<Item>
by giving a list of positions of items to be printed, or
</Item>
<Item>
by specifying a first item and then a regular step.
</Item>
</List>
<ManSection>
<Func Name="PrintSelection"
Arg="obj list"
Label="for a list of positions" />
<Func Name="PrintSelection"
Arg="obj first step [last]"
Label="for a first item and a step" />
<Description>
This function, given three (or four) parameters, calls operations
<C>PrintSelectionFromList</C> or <C>PrintSelectionFromIterator</C>
which prints the <E>first</E> item specified,
and then the item at every <E>step</E>.
The fourth parameter is essential when the object being printed is infinite.
<P/>
Alternatively, given two parameters,
with the second parameter a list <C>L</C> of positive integers,
only the items at positions in <C>L</C> are printed.
<P/>
</Description>
</ManSection>
<Example>
<![CDATA[
gap> L := List( [1..20], n -> n^5 );;
gap> PrintSelection( L, [18..20] ); 18 : 1889568 19 : 2476099 20 : 3200000
gap> PrintSelection( L, 2, 9 ); 2 : 32 11 : 161051 20 : 3200000
gap> PrintSelection( L, 2, 3, 11 ); 2 : 32 5 : 3125 8 : 32768 11 : 161051
gap> s5 := SymmetricGroup( 5 );;
gap> PrintSelection( s5, [30,31,100,101] ); 30 : (1,5)(3,4) 31 : (1,5,2) 100 : (1,4,3) 101 : (1,4)(3,5)
gap> PrintSelection( s5, 1, 30 ); 1 : () 31 : (1,5,2) 61 : (1,2,3) 91 : (1,3,5,2,4)
gap> PrintSelection( s5, 9, 11, 43 ); 9 : (2,5,3) 20 : (2,4) 31 : (1,5,2) 42 : (1,5,2,3,4)
]]>
</Example>
</Section>
</Chapter>
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-07-02)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.