MathGroup Archive 2013

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

Search the Archive

(Curious) behavior of Reap

  • To: mathgroup at smc.vnet.net
  • Subject: [mg129947] (Curious) behavior of Reap
  • From: Roger Wilson <rogerhw999 at gmail.com>
  • Date: Wed, 27 Feb 2013 23:42:34 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

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[]