5.72 PermuteWith

• PermuteWith( <index list>, <list to permute>, [, packets size or jump] )
• Description: the <list to permute> has to be a variable, it will be permuted following the <index list> that is a positive integer list. The <liste to permute> is handled by component if it contain the constant jump, elements of each component are treated by packet (of $1$ by default) of by complete component (ie: ended by jump), the list is then modified.
• Exemple(s): :
• [L:=[-1,0,3,5], PermuteWith([4,3,2,1], L), L] returns [5,3,0,-1].
• [L:=[-1,0,3,5], PermuteWith([4,3,4,1], L), L] returns [5,3,5,-1].
• [L:=[-1,0,3,5,6,7,8], PermuteWith([4,3,2,1], L, 2), L] returns [6,7,3,5,-1,0].
• [L:=[-1,jump,0,3,jump,5,6,7,jump,8,jump], PermuteWith( [4,3,3,1,2], L, jump), L] returns [8,jump,5,6,7,jump,5,6,7,jump,-1,jump,0,3,jump].
• [L:=[-1,jump,0,3,jump,5,6,7,jump,8], PermuteWith([4,3,3,1,2], L, jump), L] returns [5,6,7,jump,5,6,7,jump,-1,jump,0,3,jump].
• [L:=[-1,1,5,jump,0,3,jump,5,6,7,jump,8,9], PermuteWith( [2,1], L), L] returns [1,-1,jump,3,0,jump,6,5,jump,9,8].