Closed timobaumann closed 5 years ago
I don't think this is possible, and it's not clear to me that we want this.
Any solution that I can think of seems quite brittle, and I'd be inclined to leave this to advanced users who use Groovy scripts and know what a classpath is.
I'm thinking there should be something similar to Node.registerNodeType for script functions that should become available in the language when the plugin is loaded. In fact, the present handling of the "DialogOS-Script-Functions" is beyond weird. I don't see how this would be britte.
I, for one, am a sort-of-advanced user who, lacking documentation on Groovy script, still uses the script language.
lacking documentation on Groovy
plugins may now provide their own script functions by overriding Plugin#registerScriptFunctions()
and returning ExecutableFunctionDescriptor
s that directly contain what's to be computed in eval()
.
An example of how a plugin might want to use this is given in 7240b67
Here is the documentation on Groovy nodes: https://github.com/dialogos-project/dialogos/wiki/Groovy-Functions
I don't find an obvious way of adding a "semi-builtin" function to provide additional functionality from a plugin. Any hints? (not the groovy hint, please.)