Skip to content

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

Open
bwakabats wants to merge 5 commits into
matheval:mainfrom
bwakabats:external-registration
Open

Proposed enhancements for issue #7, based on work by MSpekkio#19
bwakabats wants to merge 5 commits into
matheval:mainfrom
bwakabats:external-registration

Conversation

@bwakabats

@bwakabats bwakabats commented Aug 14, 2023

Copy link
Copy Markdown

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
Copy Markdown

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

@mikhail-teslya

Copy link
Copy Markdown

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

@dei79

dei79 commented May 31, 2024

Copy link
Copy Markdown

@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.

4 participants