public override T Eval() { TailCall <T> tailRec = this; while (tailRec.IsSuspend()) { tailRec = tailRec.Resume(); } return(tailRec.Eval()); }
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))); }