This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Sow

Sow[e]
specifies that e should be collected by the nearest enclosing Reap.
Sow[e, tag]
specifies that e should be collected by the nearest enclosing Reap whose pattern matches tag.
Sow[e, {tag1, tag2, ...}]
specifies that e should be collected once for each pattern that matches a tagi.
  • Sow[e, ...] returns e.
  • By having several identical tagi, a single expression can be made to appear multiple times in a list returned by Reap.
  • Sow[e, {{tag}}] sows an expression with tag {tag}.
Evaluate a sequence of expressions, "sowing" some to be collected by Reap:
In[1]:=
Click for copyable input
Out[1]=
 
Compute a sum, "sowing" i^2 at each step:
In[1]:=
Click for copyable input
Out[1]=
 
Make separate lists for expressions "sown" with different tags:
In[1]:=
Click for copyable input
Out[1]=
 
Reap only expressions "sown" with tag x:
In[1]:=
Click for copyable input
Out[1]=
New in 5