Reap[body] returns a list of lists of expressions accumulated by Sow[ expr ] or Sow[expr, tag] during evaluation of body. The output of Reap contains one list for each distinct tag value used with Sow, and one list for all elements sown by the untagged form.
Reap[body, patt] returns a list of lists of expressions sown by Sow[elem, tag] during evaluation of body, with tags matching the pattern patt.
Reap[body, , , ... ] returns , , ... , where is the result one would expect if one used Reap[body, ].
Reap[body, patt, f] returns f[tags, lists], where tags is a list of all the Sow tags encountered, and the lists are the corresponding lists of sown expressions.
Reap and Sow provide a way to obtain lists of expressions that may be produced at each cycle of an iterative procedure, without explicitly appending to one or more lists at each iteration.
When one Reap encloses another, sown expressions will go to the innermost matching Reap.
The default tag for Sow is None. The default pattern for Reap is _.
See also: Catch, Throw, AppendTo.
Note: this is an experimental feature, and in future versions of Mathematica it may not be supported, or may have a different specification.
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER
FOR THE LATEST INFORMATION.