PaesslerAG / gval

Expression evaluation in golang
BSD 3-Clause "New" or "Revised" License
713 stars 83 forks source link

Allow variables to overload functoins #82

Open smyrman opened 2 years ago

smyrman commented 2 years ago

Is it be possible to configure a language so that variable names takes precedence over functions?

Use case: for a system that stores expressions, allow adding new functions to the language without breaking backwards-compatibility.

Exmaple: for a language with function sin, in the expresison sin + b -- treat sin as variable instead of a functoin if present.

smyrman commented 2 years ago

FYI, we do got a work-around that we find acceptable, which is to define a new language on the fly, with each function added tot the language only if there are no input variables with the same name.

generikvault commented 2 years ago

Hi, gval is not under activly development by paessler ag. I'm accepting merge request and try to answer the issues as an side project. As far as I know this isl only possible with replacing the Ident Expansion.