MathGroup Archive 2003

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

Search the Archive

Nesting Pure Functions with more than one variable

  • To: mathgroup at smc.vnet.net
  • Subject: [mg42295] Nesting Pure Functions with more than one variable
  • From: "Ashraf El Ansary" <Elansary at btopenworld.com>
  • Date: Fri, 27 Jun 2003 06:31:22 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Dear all,
I'm looking for a way to nest a pure function with more than one variable.
For Example,

In[1]:=
a={1,2,3};
b={5,6,7};
c:=Insert[#1,b[[#2]],#2+#2]&


This is what I'm trying to achieve [i.e to rearrange the above lists to
merge them together in a certain way], c[a,1]
c[%,2]
c[%,3]

Out[4]=
{1,5,2,3}
Out[5]=
{1,5,2,6,3}
Out[6]=
{1,5,2,6,3,7}
I'm more interested in the concept of making a loop [or nesting a function]
than achieving the end result.

I'd assume that I'd need to nest c in a such way that my starting point
would be
#1=a , #2 = 1 then nest the result several times while increasing #2 by one
increment each time

Any idea!!!

Your help is extremely appreciated


Ashraf



  • Prev by Date: SparseArray problem
  • Next by Date: Re: Mesh in ListDensityPlot
  • Previous by thread: SparseArray problem
  • Next by thread: RE: Nesting Pure Functions with more than one variable