From: ts Date: 2004-01-29T23:38:02+09:00 Subject: Re: Bignums and return >>>>> "A" == Andre Nathan writes: A> Why do I get these different errors? the short answer : you don't want to know. A> Why does an explicit 'return' or compiling ruby with --enable-pthreads A> changes the behaviour? Adding an explicit return, add a function call. This is why ruby detect quickly the stack overflow. --enable-pthreads modify internally the calls, and this explain also the difference. A> Also, I'm really puzzled by this one: if I put the two functions on the A> *same file*, fact2(1377) (or fact2(842) with '--enable-pthread') will A> give the following error: "Bignum can't be coerced into Fixnum" instead A> of the "stack level too deep" one. When ruby try to convert to a Fixnum it do begin # try the conversion rescue raise "Bignum can't be coerced into Fixnum" end if it detect the stack overflow when it's in the begin..rescue it will give the error "Bignum can't be coerced into Fixnum". If it detect the stack overflow outside the begin...rescue it give 'stack level too deep' This is the same error, but ruby give 2 different messages (because it's in a begin...rescue) Guy Decoux