Re: Recursion limit: a good idea to ignore?
- To: mathgroup at smc.vnet.net
- Subject: [mg82266] Re: Recursion limit: a good idea to ignore?
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Tue, 16 Oct 2007 03:36:25 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <feutsm$st$1@smc.vnet.net>
Will Robertson wrote:
> I've written a potentially inefficient algorithm to combine multiple
> joined polygons into a single one. On large plots I get the warning
> "$RecursionLimit::reclim: Recursion depth of 256 exceeded." and a
> bunch of errors because of this.
>
> Now, should I try and re-write my program (the speed of it is not
> entirely critical) to avoid recursion or is it "okay" to locally
> remove the recursion limit for such code?
<snip>
It is perfectly OK to set $RecursionLimit to a higher value in some
portion of the code you write with a Block construct (so it does not
interfere with the rest of Mathematica and the value is automatically
reset to its default when the Block construct is exited). For instance,
Block[{$RecursionLimit = 2000},"...your code that need lot of
recursions..."]
Regards,
--
Jean-Marc