Mathematica 9 is now available

Documentation / Mathematica / Built-in Functions / Programming / Flow Control /

Reap

FilledSmallSquare Reap[expr] gives the value of expr together with all expressions to which Sow has been applied during its evaluation.

FilledSmallSquare Expressions sown using Sow[e] or Sow[e, ] with different tags are given in different lists.

FilledSmallSquare Reap[expr, patt] reaps only expressions sown with tags that match patt.

FilledSmallSquare Reap[expr, , , ... ] puts expressions associated with each of in a separate list.

FilledSmallSquare Reap[expr, patt, f] returns expr, f[, , , ... ], ... .

FilledSmallSquare Sow and Reap provide a convenient way to accumulate a list of intermediate results in a computation.

FilledSmallSquare Reap accumulates expressions in the order in which Sow is applied to them.

FilledSmallSquare Expressions sown with a particular tag are collected by the innermost Reap whose pattern matches the tag.

FilledSmallSquare Reap[expr] is equivalent to Reap[expr, _].

FilledSmallSquare Reap has attribute HoldFirst.

FilledSmallSquare See Section 2.4.1 and Section 2.6.10.

FilledSmallSquare See also: Sow, Catch, AppendTo, Print.

FilledSmallSquare New in Version 5.0.

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.