$RecursionLimit

*To*: mathgroup at smc.vnet.net*Subject*: [mg37384] $RecursionLimit*From*: "Nick Fortescue" <nick.fortescue at smartspread.com>*Date*: Sat, 26 Oct 2002 02:03:06 -0400 (EDT)*Sender*: owner-wri-mathgroup at wolfram.com

Hi, While testing something yesterday I discovered some behaviour which I hoped would be handled better by Mathematica's $RecursionLimit. Is this a defectshow b which should be reported to WRI? It's a very simple example, in a notebook just type: foo[x_] = foo[foo[x]] You get the following error messages coming up one by one, with 4 beeps (used copy as->Plain text). All of these messages seem sensible. However, Mathematica then eats all the CPU, and if you don't abort memory usage goes up and up until eventually I get a low virtual memory message from Windows. I guess this is something to do with pattern matching in error results. In[1]:= foo[x_] = foo[foo[x]] $RecursionLimit::"reclim": "Recursion depth of \!\(256\) exceeded." $RecursionLimit::"reclim": "Recursion depth of \!\(256\) exceeded." $RecursionLimit::"reclim": "Recursion depth of \!\(256\) exceeded." General::"stop": "Further output of \!\($RecursionLimit :: \"reclim\"\) will \ be suppressed during this calculation." $IterationLimit::"itlim": "Iteration limit of \!\(4096\) exceeded." $IterationLimit::"itlim": "Iteration limit of \!\(4096\) exceeded." $IterationLimit::"itlim": "Iteration limit of \!\(4096\) exceeded." General::"stop": "Further output of \!\($IterationLimit :: \"itlim\"\) will \ be suppressed during this calculation." Platform: Mathematica 4.2 on both Windows XP and Mac OS X Nick Fortescue Smartspread Ltd.