Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

A Reap Sow question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65193] A Reap Sow question
  • From: János <janos.lobb at yale.edu>
  • Date: Fri, 17 Mar 2006 00:13:34 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

First, thanks a lot to Valeri Astanoff, Daniel Lichtblau, David Park  
and Carl Woll  for the valuable suggestions to my previous post.

Let say I have a construct like

collection=Reap[i=1; While[i<=10,Sow[i]];]

Is it possible to put a condition on Sow referring back to  
collection ?  Something like:

collection=Reap[i=1; While[i<=10,If[Length[First[Last[collection]] ] 
 >5,,Sow[i] ] ];]

If not, - I have not seen any indication in Help either way - , what  
technique can be used to get a similar effect without resorting to  
global lists or arrays?

Thanks ahead,

János


------------------------------------------------------
I am seriously convinced that the world is ruled by complete  
lunatics. The ones who are not crazy are either refraining from it,  
or are unable to participate in it.  <Leo Tolstoy>


  • Prev by Date: Re: Laplace Transform
  • Next by Date: Re: getting one random number
  • Previous by thread: Re: Delayed Differential Equations [NDelayDSolve]
  • Next by thread: Re: A Reap Sow question