Repeated (..)
Usage
Notes
Further Examples
Here is a nested list.
In[1]:=
|
This replaces every sublist all of whose elements are x by A.
In[2]:=
|
Out[2]=
|
This replaces every sublist all of whose elements are lists consisting of x's by A.
In[3]:=
|
Out[3]=
|
This defines the function replaceRepeatedOnes which replaces ones appearing r times in a row within a list by a single one followed by r - 1 zeros.
In[4]:=
|
In[5]:=
|
Out[5]=
|
In[6]:=
|
|