Skip to content

Instantly share code, notes, and snippets.

@toptensoftware
Created October 26, 2016 02:24
Show Gist options
  • Select an option

  • Save toptensoftware/9827c3a67d0ee9270fbec6de3cb6bdcb to your computer and use it in GitHub Desktop.

Select an option

Save toptensoftware/9827c3a67d0ee9270fbec6de3cb6bdcb to your computer and use it in GitHub Desktop.
// Construct an expression tree
var expr = new NodeBinary(
new NodeNumber(10),
new NodeNumber(20),
(a,b) => a + b
);
// Evaluate it
var result = expr.Eval();
// Check
Assert.AreEqual(result, 30);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment