Your code doesn't do any work -- it's the same as:

    proc x {} {
        set somevalue 1
        while 1 {
            puts $somevalue
            incr somevalue
        }
    }

Except that my version won't consume the stack until the process breaks.  It
still doesn't do any work!  (You get the segmentation fault because your
proc eventually consumes all available stack.  If you were to try to
increase the stack, it wouldn't matter, because this function will consume
*all* stack, no matter how much you give it -- it's a seriously and
obviously flawed piece of code.)

You really need to tell us more about what you're trying to do.  You've
abstracted away too much in your sample code.

On 1/16/02 12:28 PM, "Chiriac Petrica Clement" <[EMAIL PROTECTED]> wrote:

> My code is an example for real problem.
>
> How can change this value "50" ?
> Why produce Segmentation fault ?
>
> "Peter M. Jansson" wrote:
>>
>> Don't do that!  You have an infinite recursion here.  You need to include
>> some condition in the code which will stop the recursive calls to "x" at
>> some point (preferably before 50 levels of recursion).
>>
>> On 1/16/02 12:08 PM, "Chiriac Petrica Clement" <[EMAIL PROTECTED]> wrote:
>>
>>> This code produce "Segmentation fault"
>>>
>>> proc x {} {
>>>   puts [info level]
>>>   catch {
>>>     x
>>>   }
>>> }

Reply via email to