Just for future reference, I'd probably start out with such a question on
the users mailing list. There are more folks subscribed to that list and
writing closures and transforms (using Groovy) are topics which that list
covers. If it turned out that Groovy couldn't handle your use case, the dev
list (developing the language) would be the place to go to ask whether a
feature could be added to the language.

Having said that, to answer your question, there are quite a lot of
things that are possible. Perhaps you could give a concrete simple example
of the kind of thing you are trying to do. I understand most of what you
are saying but a few bits are still a little unclear (to me at least).

Cheers, Paul.


On Mon, Feb 24, 2020 at 9:06 AM Saravanan Palanichamy <chava...@gmail.com>
wrote:

> Hello
>
> Is it possible to do this in the groovy AST transformation ->
>
> a) in a code visitor, visit a closure expression (in the
> INSTRUCTION_SELECTION phase)
> b) Using the Closure Node, execute this code to determine its results
> based on different parameters
>
> Essentially I want to be able to selectively run a closure defined in code
> during the compile process. I see you can convert closures into strings, is
> it possible to compile that string in the middle of a compile process?
>
> I am not sure this is the right forum for this question, please let me
> know if otherwise
>

Reply via email to