ListTools - Maple Programming Help

ListTools

 pad the elements in a list

 Calling Sequence Pad[N](pd[1], ..., pd[N-1], L, pd[N], ...)

Parameters

 N - positive integer; location of list L in the argument sequence L - list pd[1], p[2], ... - objects to pad the list elements with

Description

 • The Pad[N](..., L, ...) function  returns a new list that contains the elements of list L surrounded by the specified objects pd[1], pd[2], ....
 In the list that is returned by Pad, each element of L is located at position N in the series of specified objects pd[1], pd[2], ....

Examples

 > $\mathrm{with}\left(\mathrm{ListTools}\right):$
 > $L≔\left[a,b,c\right]$
 ${L}{:=}\left[{a}{,}{b}{,}{c}\right]$ (1)
 > $\mathrm{Pad}[2]\left(\mathrm{LL1},L,\mathrm{RR1},\mathrm{RR2}\right)$
 $\left[{\mathrm{LL1}}{,}{a}{,}{\mathrm{RR1}}{,}{\mathrm{RR2}}{,}{\mathrm{LL1}}{,}{b}{,}{\mathrm{RR1}}{,}{\mathrm{RR2}}{,}{\mathrm{LL1}}{,}{c}{,}{\mathrm{RR1}}{,}{\mathrm{RR2}}\right]$ (2)