示例#1
0
            public override T Eval()
            {
                TailCall <T> tailRec = this;

                while (tailRec.IsSuspend())
                {
                    tailRec = tailRec.Resume();
                }
                return(tailRec.Eval());
            }
示例#2
0
 private static TailCall <BigInteger> Sum(BigInteger arg, BigInteger acc)
 {
     return(arg == 0
         ? (TailCall <BigInteger>) TailCall <BigInteger> .Ret(acc)
         : TailCall <BigInteger> .Sus(() => Sum(arg - 1, acc + arg)));
 }