Better language granularity
preciselytom opened this issue · 2 comments
Hi!
We would like to integrate gval into our platform, so that our users can write their own arithmetic expressions. However, in order to keep the language well defined, we would like to select exactly which operators to allow, in our case it would be - ( ) + - * /
and nothing more.
We could duplicate the definitions of base
and arithmetic
and strip them down, but it feels wrong to duplicate the inline code (which is library internals) outside the library, as there might be compatibility issues in the future.
Therefore we would welcome improved granularity, so that operators can be chosen on an individual basis. If you don't have time to implement it, would you accept a PR with such a change?
Best Regards,
Tom Weber
Precisely AB
Hi Tom Weber,
I think the language for ( )
and invert -
could be directly accessable. The other operators are basicly one liners plus precedence d the getter for each Operator would flood the godoc. So I would just copy / rewrite them.
Best Regards,
Jan Erik Keller
Okay, thanks!