MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

(Curious) behavior of Reap


If tags are not specified when collecting results using Reap previously pushed into Sow the results are returned in a list of sublists...

Reap[Sow[1, a]; Sow[2, a]; Sow[3, b];]
{Null, {{1, 2}, {3}}}

If tags are specified the results are returned in nested sublists...
Reap[Sow[1, a]; Sow[2, a]; Sow[3, b];, {a, b}]
{Null, {{{1, 2}}, {{3}}}}

I would have expected no difference in the structure of the results returned.

Is this simply a historical inconsistency in Mathematica or is this behavior intended and if so what purpose does it serve?



  • Prev by Date: A bug-looking behavior during integration
  • Next by Date: Issues with Rendering of Graphics[]
  • Previous by thread: Re: A bug-looking behavior during integration
  • Next by thread: Issues with Rendering of Graphics[]