ExpressionEvaluator icon indicating copy to clipboard operation
ExpressionEvaluator copied to clipboard

A Simple Math and Pseudo C# Expression Evaluator in One C# File. Can also execute small C# like scripts

Results 31 ExpressionEvaluator issues
Sort by recently updated
recently updated
newest added

Slow EvaluateCast

[{"_id":"6696325f6753f2abdc027303","body":"I had similar issues and finally found out for my case.\r\nI hope this could be at least a hint for your case.\r\n\r\nIn my case,\r\nAssemblies loads many DLLs from my AppDomain (as my solution contains many DLLs)\r\n\r\nSo, I tried to remove all unnecessary DLLs being loaded.\r\n\r\nvar engine = new ExpressionEvaluator();\r\n\r\n \/\/ load assemblies needed for script\r\n engine .Assemblies.Clear();\r\n engine .Assemblies.Add(Assembly.Load(\"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\"));\r\n engine .Assemblies.Add(Assembly.Load(\"MyDLL1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\"));\r\n engine .Assemblies.Add(Assembly.Load(\"MyDLL2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\"));\r\n\r\n \/\/ add namespaces \r\n engine .Namespaces.Add(\"MyLib.MyClass\");\r\n engine .Namespaces.Add(\"MyLib2.MyClass2\");\r\n\r\n \/\/ add types\r\n engine .Types.Add(typeof(MyLib.MyClass));\r\n engine .Types.Add(typeof(MyLib2.MyClass2));\r\n\r\n \/\/ then call evaluator\r\nvar result = eingine.ScriptEvaluate(engine.RemoveComments(expression));\r\n\r\nafter doing this, > 500ms total time reduced to 31ms\r\n\r\nHope this helps!\r\n\r\n\r\n","issue_id":1663915342706,"origin_id":1312298983,"user_origin_id":11324275,"create_time":1668215761,"update_time":1668215761,"id":1721119327870,"updated_at":"2024-07-16T08:42:07.869000Z","created_at":"2024-07-16T08:42:07.869000Z"}] comment

After upgrading to the last version from 1.4.16.0 we are encountering performance issues on the EvaluateCast function. ![image](https://user-images.githubusercontent.com/1119371/190107897-d1bc9d80-7130-42d5-9ea3-4539e87c4bdb.png) The slowdown is caused by the use of the EvaluateType method instead...

Hello, We have integrated the library in our application which uses big decimal numbers and we encountered issues regarding math operations such as Abs and Max but I believe all...

Maybe You will be interested in hosting API Explorer online: [![Static Badge](https://img.shields.io/badge/API%20Documentation-RobiniaDocs-43bc00?logo=readme&logoColor=white)](https://www.robiniadocs.com/d/codingseb-expressionevaluator/api/CodingSeb.ExpressionEvaluator.html) https://www.robiniadocs.com/d/codingseb-expressionevaluator/api/CodingSeb.ExpressionEvaluator.html

documentation

If trying to evaluate `foo.a`, I have the `_evaluatevariable` call bask as follows: ``` c# private void _evaluator_EvaluateVariable(object? sender, VariableEvaluationEventArg e) { if (e.Name == "foo") { e.Value = new...

[CASE] 0. Declare Variable First uint value = 1; 1. The variable type is unit at this point. 2. Assign a value to it value = 10; 3. Now the...

bug

Fatal error in Unity CIL Linker Mono.Linker.LinkerFatalErrorException: ILLink: error IL1005: CodingSeb.ExpressionEvaluator.ExpressionEvaluator.GetTypeByFriendlyName(String,String,Boolean): Error processing method 'CodingSeb.ExpressionEvaluator.ExpressionEvaluator.GetTypeByFriendlyName(String,String,Boolean)' in assembly 'CodingSeb.ExpressionEvaluator.dll' ---> System.NullReferenceException: Object reference not set to an instance of an object....

The expression evaluator fails to identify and call the correct instance of an overloaded method in a context object when a ```Func```-parameter is included. Instead, the top implemented instance of...

Fix for #167: Handle nested ternary expressions without requiring parentheses

The formula `1 == 2 ? 3 == 4 ? 1 : 0 : 0` throws exception > System.NotSupportedException : Failed to evaluate expression for '1 == 2 ? 3...

Hi, Recently came across `numexpr` https://github.com/pydata/numexpr that can do expressions on arrays eg. `3*a+4*b` where `a` and `b` are arrays. Is this kind of expression possible in `ExpressionEvaluator`. if not...

question