skx/evalfilter

Allow users to define functions ..

skx opened this issue · 0 comments

skx commented

The current state of the scripting engine is pretty good, but one thing that annoys me is that I have had to define a bunch of functions (in golang) to make it work for a couple of specific use-cases.

The logic I desire isn't so very complicated, but it is a bit much to place inline multiple times. Adding support for user-defined functions would significantly improve the engine:

   function hello( name ) {
        printf("Hello, %s\n", name );
   }

This would allow is_weekday(), weekend?(), etc, as well as other things I've not considered.

The code here started out in-house, and has later been hugely derivative of the monkey codebase. So lets do this in a different way, as part of the learning process 👍