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

Re: Something in the spirit of letrec

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68462] Re: Something in the spirit of letrec
  • From: "Mariano Suárez-Alvarez" <mariano.suarezalvarez at gmail.com>
  • Date: Sun, 6 Aug 2006 02:56:35 -0400 (EDT)
  • References: <eb1ksk$ef3$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Bill Rowe wrote:
> On 8/4/06 at 3:59 AM, mariano.suarezalvarez at gmail.com (Mariano
> Suárez-Alvarez) wrote:
>
> >I'm trying to somehow come up with a function WithSelf such that
> >evaluating
>
> >WithSelf[{a,self[1]+b,self[2]+2}]
>
> >will result in {a,a+b,a+b+c}.
>
> FoldList does this, i.e.,
>
> In[2]:=
> Rest@FoldList[Plus,0,{a,b,c}]
>
> Out[2]=
> {a,a+b,a+b+c}

I know that, but FoldList will not deal with

  {a, self[1], 1+Sin[self[1]], self[2]^self[1]}

and countless other cases ;-)

Thanks though,

-- m


  • Prev by Date: PiecewiseExpand bug?
  • Next by Date: Minimize
  • Previous by thread: Re: Something in the spirit of letrec
  • Next by thread: Re: Something in the spirit of letrec