johnlcox / motif

Scala-like pattern matching for Java 8
http://john.leacox.com/motif
Apache License 2.0
149 stars 4 forks source link

Use annotation processing for code generation #6

Open johnlcox opened 9 years ago

johnlcox commented 9 years ago

The code-generation branch is already beginning to add the ability to generate all of the case permutations for a given type (e.g. Tuple2 or List) so that they don't have to be handwritten. Currently this requires generating the code and then copying it into a class file.

It would be nice if there was an annotation that could be added to generator classes such that the Cases code gets generated automagically as part of the compile.

jbgi commented 9 years ago

You may be interested in https://github.com/derive4j/derive4j that does exactly that.