PrependTo
Usage
• PrependTo[s, elem] 对s的值优先考虑elem,对结果重设s 。
Notes
• PrependTo[s, elem]等于s = Prepend[s, elem]. • PrependTo[s, elem]并不计算s. • 可以重复使用PrependTo建立一个列表。 • 参见 Mathematica 全书 : 节 2.4.4.
Further Examples
This prepends the number 44 to the beginning of the list.
In[1]:=
|
Out[1]=
|
In[2]:=
|
Out[2]=
|
The original list is changed as a side effect.
In[3]:=
|
Out[3]=
|
On the other hand, Prepend does not change the new version of the list.
In[4]:=
|
Out[4]=
|
In[5]:=
|
Out[5]=
|
In[6]:=
|
|