Expression problem: Difference between revisions

Content deleted Content added
Line 162:
public static int EvaluateTheSumOfOneAndTwo() => AddOneAndTwo().Eval();
}
</syntaxhighlight>Using this library we can express the arithmetic expression ''1 + 2'' as we did in ''ExampleOne.AddOneAndTwo()'' and can evaluate the expression by calling ''.Eval()''. Now imagine that we wish to extend this library, adding a new type is easy because we are working with an [[Object-oriented programming|Object-oriented Orientedprogramming Programming Languagelanguage]]. For example, we might create the following class:<syntaxhighlight lang="c#" line="1">
public class Mult : IEvalExp
{