DOCUMENTATION CENTER SEARCH
Mathematica
>
Parts of Expressions
>
Built-in
Mathematica
Symbol
Constructing Lists
Collecting Expressions During Evaluation
Tutorials »
|
Reap
Throw
AppendTo
EvaluationMonitor
StepMonitor
Monitor
Scan
See Also »
|
Constructing Lists
Language Overview
List Manipulation
Parts of Expressions
Tuning & Debugging
More About »
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
, {
tag
1
,
tag
2
,
...
}]
specifies that
e
should be collected once for each pattern that matches a
tag
i
.
MORE INFORMATION
Sow
[
e
,
...
]
returns
e
.
By having several identical
tag
i
, a single expression can be made to appear multiple times in a list returned by
Reap
.
Sow
[
e
]
is equivalent to
Sow
[
e
,
None
]
.
Sow
[
e
, {{
tag
}}]
sows an expression with tag
{
tag
}
.
EXAMPLES
CLOSE ALL
Basic Examples
(4)
Evaluate a sequence of expressions, "sowing" some to be collected by
Reap
:
In[1]:=
Out[1]=
Compute a sum, "sowing"
i^2
at each step:
In[1]:=
Out[1]=
Make separate lists for expressions "sown" with different tags:
In[1]:=
Out[1]=
Reap only expressions "sown" with tag
x
:
In[1]:=
Out[1]=
Scope
(5)
Applications
(3)
Properties & Relations
(2)
SEE ALSO
Reap
Throw
AppendTo
EvaluationMonitor
StepMonitor
Monitor
Scan
TUTORIALS
Constructing Lists
Collecting Expressions During Evaluation
MORE ABOUT
Constructing Lists
Language Overview
List Manipulation
Parts of Expressions
Tuning & Debugging
New in 5
© 2008 Wolfram Research, Inc.