MathGroup Archive 1997

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

Search the Archive

Re: Lists and Recursion

  • To: mathgroup at smc.vnet.net
  • Subject: [mg9515] Re: Lists and Recursion
  • From: Hein Hundal <hundalhm at vicon.net>
  • Date: Sat, 8 Nov 1997 23:04:42 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

W. Meeussen wrote:
> 
> hi Joana,
> 
> something like parts[li_]:=If[AtomQ[li],li,{li,Sequence@@parts/@li}]
> 

I like

parts[{}] = {{}};
parts[li_List]:= Join[#, Prepend[#,First[li]]& /@#]& [parts[Rest[li]]];


but something shorter should exist.

Hein


  • Prev by Date: Loading packages
  • Next by Date: Re: Splitting plot label
  • Previous by thread: Re: Lists and Recursion
  • Next by thread: Re: Lists and Recursion