This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
3 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,6 @@ | ||
[![Continuous Integration](https://github.com/ncalc/ncalc-async/actions/workflows/ci.yml/badge.svg)](https://github.com/ncalc/ncalc-async/actions/workflows/ci.yml) | ||
[![Nuget](https://img.shields.io/nuget/v/NCalcAsync)](https://www.nuget.org/packages/NCalcAsync/) | ||
|
||
# NCalcAsync | ||
|
||
NCalcAsync is a fully async port of the [NCalc](https://github.com/ncalc/ncalc) mathematical expressions evaluator in .NET. NCalc can parse any expression and evaluate the result, including static or dynamic parameters and custom functions. | ||
|
||
For general documentation refer to the NCalc wiki: | ||
* [description](https://github.com/ncalc/ncalc/wiki/Description): overall concepts, usage and extensibility points | ||
* [operators](https://github.com/ncalc/ncalc/wiki/Operators): available standard operators and structures | ||
* [values](https://github.com/ncalc/ncalc/wiki/Values): authorized values like types, functions, ... | ||
* [functions](https://github.com/ncalc/ncalc/wiki/Functions): list of already implemented functions | ||
* [parameters](https://github.com/ncalc/ncalc/wiki/Parameters): on how to use parameters expressions | ||
|
||
## API differences between NCalc and NCalcAsync | ||
|
||
Expressions are evaluated using `Expression.EvaluateAsync()` instead of `Expression.Evaluate()`. | ||
|
||
Async custom parameter and function handlers are assigned to `Expression.EvaluateParameterAsync` | ||
and `Expression.EvalauteFunctionAsync`, instead of adding event handlers. They are asynchronous | ||
and thus return a `Task` but otherwise behave the same way as the handlers in NCalc, i.e. they set | ||
`args.Result` to pass back the result and indicate that it handled the symbol. Multiple handlers | ||
can be added with `+=`, just like in NCalc. They are awaited in order, so if one of them blocks | ||
the following handlers will not be called until it returns. | ||
|
||
`FunctionArgs.EvaluateParametersAsync()` replaces `FunctionArgs.EvaluateParameters()`. | ||
|
||
Custom `LogicalExpressionVisitor` implementations must be fully asynchronous. | ||
NCalcAsync is a fully async port of the [NCalc](https://github.com/ncalc/ncalc) mathematical expressions evaluator in .NET. NCalc can parse any expression and evaluate the result, including static or dynamic parameters and custom functions. Originally created by [@petli](https://github.com/petli). | ||
|
||
The custom `LogicalExpression.ToString()` is removed. | ||
> [!CAUTION] | ||
> ⚠️This repository is discontinued and merged at NCalc main repo, please go to [NCalc main repository](https://github.com/ncalc/ncalc) to receive support.⚠️ |