ListTools - Maple Programming Help

Home : Support : Online Help : Programming : Data Types : Tables, lists, and sets : ListTools Package : ListTools/JoinSequence

ListTools

 JoinSequence
 interspace the elements of a list with objects

 Calling Sequence JoinSequence(L, seps)

Parameters

 L - list seps - any sequence of Maple objects

Description

 • The JoinSequence(L, seps) function inserts the separators seps between the elements of the list L.
 • In the case that the separator is a single Maple object, using the routine ListTools[Join] results in better performance.

Examples

 > $\mathrm{with}\left(\mathrm{ListTools}\right):$
 > $L≔\left[1,2,3,4,5\right]$
 ${L}{≔}\left[{1}{,}{2}{,}{3}{,}{4}{,}{5}\right]$ (1)
 > $\mathrm{JoinSequence}\left(L,x,y\right)$
 $\left[{1}{,}{x}{,}{y}{,}{2}{,}{x}{,}{y}{,}{3}{,}{x}{,}{y}{,}{4}{,}{x}{,}{y}{,}{5}\right]$ (2)