MathGroup Archive 2009

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

Search the Archive

Flatten alternative

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105469] Flatten alternative
  • From: Jezzybear <jezzybear19 at hotmail.co.uk>
  • Date: Fri, 4 Dec 2009 04:31:36 -0500 (EST)

I am trying to create a function myflat[list] to mimic the behavior of
Mathematica's Flatten[]
function.Example:
In[1]:= myflat[{{{a}}, {b, c}, {d}}]
Out[1]= {a, b, c, d}
In[2]:= myflat[{{}, 1, {{2}}}]
Out[2]= {1, 2}
However in writing this function I want to use only  Mathematica's
pattern matching features, the functions
First[], Rest[], Prepend[], ListQ[]. I am trying to do this using some
subfunctions like creating one called myjoin



  • Prev by Date: Re: How to make large graphics object fit within a plot?
  • Next by Date: Re: Manipulate jitter
  • Previous by thread: Re: Re: Plot3d causes crash with radeon driver and
  • Next by thread: Re: Flatten alternative