|
|
|
|
|
by seanmcdirmid
2478 days ago
|
|
You can easily use expressions to create trees rather than values in a library. Eg a + b need not compute a value, through a bit of operating overloading it can compute the tree plus(tree-a, tree-b). This “trick” does not extend to statements, however. You can’t override if or semicolon in most languages. You can encode statements as expressions, but then you have to worry about things like variable bindings on your own. |
|
This generalizes to partial derivatives for multivariate functions too: