Re: Detecting endless recursion?

Lex Spoon <lex@cc.gatech.edu>
22 Jan 2004 23:28:17 -0500

          From comp.compilers

Related articles
[8 earlier articles]
Re: Detecting endless recursion? witness@t-online.de (Uli Kusterer) (2004-01-16)
Re: Detecting endless recursion? Martin.Ward@durham.ac.uk (Martin Ward) (2004-01-16)
Re: Detecting endless recursion? vbdis@aol.com (2004-01-16)
RE: Detecting endless recursion? qjackson@shaw.ca (Quinn Tyler Jackson) (2004-01-17)
Re: Detecting endless recursion? joachim.durchholz@web.de (Joachim Durchholz) (2004-01-18)
Re: Detecting endless recursion? nmm1@cus.cam.ac.uk (2004-01-22)
Re: Detecting endless recursion? lex@cc.gatech.edu (Lex Spoon) (2004-01-22)
Re: Detecting endless recursion? torbenm@diku.dk (2004-01-31)
Re: Detecting endless recursion? witness@t-online.de (Uli Kusterer) (2004-01-31)
Re: Detecting endless recursion? witness@t-online.de (Uli Kusterer) (2004-02-01)
Re: Detecting endless recursion? witness@t-online.de (Uli Kusterer) (2004-02-01)
Re: Detecting endless recursion? joachim.durchholz@web.de (Joachim Durchholz) (2004-02-01)
Re: Detecting endless recursion? joachim.durchholz@web.de (Joachim Durchholz) (2004-02-01)
[13 later articles]
| List of all articles for this month |

From: Lex Spoon <lex@cc.gatech.edu>
Newsgroups: comp.compilers
Date: 22 Jan 2004 23:28:17 -0500
Organization: Georgia Institute of Technology
References: 04-01-104
Keywords: debug
Posted-Date: 22 Jan 2004 23:28:17 EST

Quinn Tyler Jackson <qjackson@shaw.ca> writes:


> Uli Kusterer said:
>
>> The best suggestion I've been able to get from some mailing lists was
>> to just put a limit on the size of my pseudo-stack and when that is
>> exceeded raise an error. This is very straightforward and would be
>> easy to implement (and I feel stupid for not thinking of this), but I
>> have no idea how to determine this limit.
>
> I'm going to suggest something non-standard, but since this is a "language
> for beginners" you might want to consider it.
>
> Allow the programmer to define an event callback function that is called
> when some function reaches the default limit of recursion on any given
> function, and if that callback returns > 0 -- go deeper by up to that
> amount. If it returns 0 -- terminate the program with a "recursion limit
> exceeded" error.




And if you really want to help beginners, make a default handler that
puts up a prompt on the display.


      Your program's stack depth has reached 100.
      What would you like to do?
                Continue running with max depth 1000
                Continue running with no max depth
                Debug


I thought this was obvious, but maybe that's from doing so much
Smalltalk. Several people are talking about "the" limit, as if it is
a fixed thing that cannot change once the program starts.




-Lex


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.