Mathematica 9 is now available

Documentation / Mathematica / Built-in Functions / Programming / Assignments /

PrependTo

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

FilledSmallSquare PrependTo[s, elem] is equivalent to s = Prepend[s, elem].

FilledSmallSquare PrependTo[s, elem] does not evaluate s.

FilledSmallSquare You can use PrependTo repeatedly to build up a list, though Sow and Reap will usually be more efficient.

FilledSmallSquare PrependTo works on SparseArray objects, returning ordinary lists if necessary.

FilledSmallSquare See Section 2.5.4.

FilledSmallSquare See also: AppendTo, Sow.

FilledSmallSquare New in Version 1.

Further Examples



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.