Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed enhancements for issue #7, based on work by MSpekkio #19

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

bwakabats
Copy link

@bwakabats bwakabats commented Aug 14, 2023

Resolves issue #7 with the ability to register external function.
Based on work by @MSpekkio in #9

The static Parser.RegisterFunction allows the registration of a type (derived from IFunction) or an instance of the same.

The functions can:

  • Add new functions (demonstrated in the Unit Tests for "Custom_Function_Test > JOIN"
  • Extend existing functions (demonstrated in "Custom_Function_Test > MID")
  • Replace existing functions (demonstrated in "Custom_Function_Replacement_Test > ISBLANK")

NOTE: There are 2 changes to the underlying code:

  1. The name of the function is now derived from the FunctionDef.Name, rather than part of the IFunction class name. So a single IFunction could, in theory, accommodate more than one math function.
  2. IFunctions must now be stateless (all existing internal IFunctions already are) since a single instance of each function is reused.

@jramoseguinoa
Copy link

@bwakabats nice work! @butulia @matheval can you please accept this PR and release a new nuget version?

@mikhail-teslya
Copy link

A wanted feature, is the one expected to be reviewed @butulia @matheval? Thanks for the effort :)

@dei79
Copy link

dei79 commented May 31, 2024

@mikhail-teslya, @bwakabats and @jramoseguinoa I derived my own version of this awesome library and included the external functions capability. Just case you need this feature: https://github.com/dei79/ExpressionEvaluationRuntime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants