Thanks for the first explanation of what is goes wrong when I try writing any non-trivial CPS script. Usually I'm prepared to do the following:
1. Define @NonCPS functions at the top level of the script, and only call them from the master node 2. Use data processing in CPS very carefully on any non-master node (e.g. no closures, not even a regexp for string manipulation) 3. Expect any feature of Groovy to fail at any time.
Needless to say, that I have a hard time explaining people how to solve a problem with CPS, even if my solutions demonstrate that it can work. Maybe it would be easier to raise the priority of such issues if CPS didn't work at all.
|