[Issue 1076] by using scope(exit) tail recursion ain't working

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 21 22:40:02 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1076





------- Comment #4 from davidl at 126.com  2007-03-22 00:39 -------
err, yep , i haven't considered the following:
void hello( int n)
{
    if (n==0) return;
    if (n%2==1)
    {
        scope(exit) printf(`%d odd`\n,n);
        hello(n-1);
    }
    if (n%2==0)
    {
        scope(exit) printf(`%d even`\n,n);
        hello(n-1);
    }
}


-- 



More information about the Digitalmars-d-bugs mailing list