gives the value of expr together with all expressions to which Sow has been applied during its evaluation. Expressions sown using Sow[e] or Sow[e,tagi] with different tags are given in different lists.
reaps only expressions sown with tags that match patt.
puts expressions associated with each of the patti in a separate list.
- Sow and Reap provide a convenient way to accumulate a list of intermediate results in a computation.
- Reap accumulates expressions in the order in which Sow is applied to them.
- Expressions sown with a particular tag are collected by the innermost Reap whose pattern matches the tag.
- Reap[expr] is equivalent to Reap[expr,_].
- Reap has attribute HoldFirst.
Examplesopen allclose all
Basic Examples (2)
Wolfram Research (2003), Reap, Wolfram Language function, https://reference.wolfram.com/language/ref/Reap.html.
Wolfram Language. 2003. "Reap." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Reap.html.
Wolfram Language. (2003). Reap. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Reap.html