Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*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 2005

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

Search the Archive

Re: functional programming excercise from Mastering Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg55275] Re: functional programming excercise from Mastering Mathematica
  • From: Jon Harrop <usenet at jdh30.plus.com>
  • Date: Fri, 18 Mar 2005 05:33:51 -0500 (EST)
  • References: <d1bflp$lja$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Torsten Coym wrote:
> Conversely, write your own
> function foldList that works just like the built-in operation with the
> same name, using ComposeList.

I get:

foldlist[f_, x_, l_List] := 
  ComposeList[Function[{a}, Function[{x}, f[x, a]]] /@ l, x]

-- 
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com


  • Prev by Date: Re: Interaction of Sum/Plus and KroneckerDelta
  • Next by Date: Clamped cubic spline
  • Previous by thread: Re: functional programming excercise from Mastering Mathematica
  • Next by thread: Re: functional programming excercise from Mastering Mathematica