Re: Recursive Includes (and the Buffer List?)

2010-09-30 Thread Richard Heck
On 9/30/10 5:53 PM, Jean-Marc Lasgouttes wrote: Le 30/09/2010 23:03, Richard Heck a écrit : It's not so much detecting the recursion. It's what to do about it once you detect it. So, say, we have: A -> B -> A. What should B.masterBuffer() return? What should A.masterBuffer() return? How do you s

Re: Recursive Includes (and the Buffer List?)

2010-09-30 Thread Richard Heck
On 9/30/10 5:53 PM, Jean-Marc Lasgouttes wrote: Le 30/09/2010 23:03, Richard Heck a écrit : It's not so much detecting the recursion. It's what to do about it once you detect it. So, say, we have: A -> B -> A. What should B.masterBuffer() return? What should A.masterBuffer() return? How do you s

Re: Recursive Includes (and the Buffer List?)

2010-09-30 Thread Jean-Marc Lasgouttes
Le 30/09/2010 23:03, Richard Heck a écrit : It's not so much detecting the recursion. It's what to do about it once you detect it. So, say, we have: A -> B -> A. What should B.masterBuffer() return? What should A.masterBuffer() return? How do you safely write recursions? I would say the second

Re: Recursive Includes (and the Buffer List?)

2010-09-30 Thread Richard Heck
On 09/30/2010 02:11 PM, Pavel Sanda wrote: Stephan Witt wrote: There is a cool algorithm to detect infinite loops without global state: Use two pointers, start both somewhere at the same point. Increment the first by one, the second by two (if not hitting the end), until one of the conditi