|
|
|
|
|
by vii
2071 days ago
|
|
For the recursive functor application example on a tree, normal meta-programming would be a macro taking the type as an argument, and then generating the resulting case by case application code, at compile time. This would be much clearer and could automatically keep working if more cases were added (adding new node types is common when adding language features to abstract syntax trees). This is a very awesome demo but my experience with other templating systems in IDEs (like autogenerated toString and other methods in Java) is that making boilerplate easy to write doesn't help make it easier to read or modify. |
|