Nathan Bedell
12/11/2021, 5:10 PM@Rule {
if (parentOf(X,Y) && parentOf(Y,Z)
grandparentOf(X,Z)
}
As it should be clear from the example here -- the idea for this is for a logic programming compiler plugin, and in particular, supporting anonymous top-level rules, rather than having to annotate e.x a top level function or val, which we would then have to name.Nathan Bedell
12/11/2021, 5:18 PM@Target(AnnotationTarget.EXPRESSION)
annotation class Rule
and then have the compiler plugin look for top-level Rule expressions, parse them, and apply it's own logic to them before removing them from the raw input that is passed on to the rest of the Kotlin compiler (which would not accept such top-level unassigned expressions)
But then again, I'm not sure if doing something like this would require language changes, or changes to the compiler plugin API.raulraja
12/11/2021, 6:09 PMraulraja
12/11/2021, 6:10 PM