expression-evaluator-c-sharp icon indicating copy to clipboard operation
expression-evaluator-c-sharp copied to clipboard

Unable to extend evaluator with additional Functions, no equivilent of AddOperation on parser.cs

Open MSpekkio opened this issue 3 years ago • 2 comments

My use case requires the ability to add into some additional simple functions for common business rule stuff (imagine a ORDER_ID() function that takes strings and produces a valid order id). In some cases, I could build the expression from using the provided functions, but since the idea of using your Evaluation engine is to expose a simple 'Excel' like set of functions for my users, the required complexity to get business rules is too high.

The Parser supports registering custom operators but the way Type.GetType locates the function identifiers, it can't locate types outside the org.matheval assembly.

See MSDN: image

With this issue I'm also uploading proposed API addition to Parser.cs. image

and image

And a simple test in TestAll.cs image

to support my use case.

Thank you.

MSpekkio avatar Nov 10 '22 18:11 MSpekkio

Note I closed my Pull Request, somehow a bunch of bad changes got pulled in. I'll rebuild my local branch and resubmitt a PR when I have some time.

MSpekkio avatar Nov 21 '22 20:11 MSpekkio

Is there any plans to merge PR for this issue?

sfadeev avatar Dec 16 '23 19:12 sfadeev