PrependTo
PrependTo[s,elem]
prepends elem to the value of s, and resets s to the result.
Details

- PrependTo[s,elem] is equivalent to s=Prepend[s,elem].
- PrependTo has attribute HoldFirst.
- You can use PrependTo repeatedly to build up a list, though Sow and Reap will usually be more efficient. »
- PrependTo works on SparseArray objects, returning ordinary lists if necessary. »
- PrependTo works on Association objects, just like Prepend.
Examples
open all close allBasic Examples (2)
Include a new value at the beginning of the list:
The value assigned to l has changed:
Prepend to an Association:
Generalizations & Extensions (2)
Applications (1)
Possible Issues (4)
Introduced in 1988
Updated in 2014
(1.0)
|
(10.0)