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
- Follow-Ups:
- Re: Flatten alternative
- From: Leonid Shifrin <lshifr@gmail.com>
- Re: Flatten alternative
- From: Leonid Shifrin <lshifr@gmail.com>
- Re: Flatten alternative
- From: Adriano Pascoletti <adriano.pascoletti@dimi.uniud.it>
- Re: Flatten alternative