Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

RE: To create {{},{},....{}} beyond $MaxRecursionLimit

  • To: mathgroup at
  • Subject: [mg46736] RE: [mg46719] To create {{},{},....{}} beyond $MaxRecursionLimit
  • From: "Wolf, Hartmut" <Hartmut.Wolf at>
  • Date: Thu, 4 Mar 2004 00:47:34 -0500 (EST)
  • Sender: owner-wri-mathgroup at

>-----Original Message-----
>From: János [mailto:janos.lobb at]
To: mathgroup at
>Sent: Wednesday, March 03, 2004 1:10 AM
>To: mathgroup at
>Subject: [mg46736] [mg46719] To create {{},{},....{}} beyond $MaxRecursionLimit
>I am in need of creating a nested list in  the form of {{},{},....{}} 
>of arbitrary length where none of the sublists have any 
>element in it.  
>I came up with
>lst = NestList[List, {},lengthlist - 1]
>For[i = 2, i <=
>     lengthlist, i++, flt = Table[{j}, {j, i, lengthlist}]; lst = 
>FlattenAt[lst, flt]]
>however it complains  when lengthlen is over 
>$MaxRecursionLimit.  I see 
>that I can change that Limit to Infinity, but I rather would not go 
>that route.  It must be a better way without using NestList.
>Any good hint ?
>Thanks ahead,
>clear perl code is better than unclear awk code; but NOTHING comes 
>close to unclear perl code


In[2]:= PadLeft[{}, 5, {{}}]
Out[2]= {{}, {}, {}, {}, {}}

should do it.


  • Prev by Date: Re: Plot3D animation problems.
  • Next by Date: Remote mathkernel through firewall behind NAT
  • Previous by thread: Re: To create {{},{},....{}} beyond $MaxRecursionLimit
  • Next by thread: Re: Elliptic Integral problem with 5.0