 |
PrependTo
PrependTo[
s
,
elem
] prepends elem to the value of s, and resets s to the result.
PrependTo[
s
,
elem
] is equivalent to s
=
Prepend[
s
,
elem
]. PrependTo[
s
,
elem
] does not evaluate s. You can use PrependTo repeatedly to build up a list. See the Mathematica book: Section 2.4.4. See also: AppendTo.
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]:= 
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT. SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION. | | | |
 | |
|