internal static void discardNext(IKernelLink ml) { switch (ml.GetNextExpressionType()) { case ExpressionType.Integer: ml.GetInteger(); break; case ExpressionType.Real: ml.GetDouble(); break; case ExpressionType.Boolean: case ExpressionType.Symbol: ml.GetSymbol(); break; case ExpressionType.String: ml.GetString(); break; case ExpressionType.Object: ml.GetObject(); break; // We would get an exception if we called GetComplex() and no complex class was set. case ExpressionType.Complex: case ExpressionType.Function: { IMathLink loop = MathLinkFactory.CreateLoopbackLink(); try { loop.TransferExpression(ml); } finally { loop.Close(); } break; } default: System.Diagnostics.Debug.Fail("Unhandled ExpressionType enum value in Utils.discardNext()."); break; } }
/****************** Implementation of IMathLink Interface by wrapping *********************/ public override void Close() { impl.Close(); }