miaplaza / expression-utils Goto Github PK
View Code? Open in Web Editor NEWEfficient Processing, Compilation, and Execution of Expression Trees at Runtime
License: MIT License
Efficient Processing, Compilation, and Execution of Expression Trees at Runtime
License: MIT License
Trying to use PartialEvaluator.PartialEvalBody(where, ExpressionInterpreter.Instance);
to remove the closure from u => u.UserID.Value > 1
where UserID is a ulong? produces the following error:
---> Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Operator '>' cannot be applied to operands of type 'int' and 'ulong'
at CallSite.Target(Closure , CallSite , Object , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at MiaPlaza.ExpressionUtils.Evaluating.ExpressionInterpreter.ExpressionInterpretationVisitor.uncheckedConvert(Object original, Type target)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at MiaPlaza.ExpressionUtils.Evaluating.ExpressionInterpreter.ExpressionInterpretationVisitor.GetResultFromUnary(UnaryExpression exp)
at MiaPlaza.ExpressionUtils.ExpressionResultVisitor`1.DispatchVisitor.VisitUnary(UnaryExpression node)
at System.Linq.Expressions.UnaryExpression.Accept(ExpressionVisitor visitor)
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
at MiaPlaza.ExpressionUtils.ExpressionResultVisitor`1.GetResultFromExpression(Expression expression)
at MiaPlaza.ExpressionUtils.Evaluating.ExpressionInterpreter.ExpressionInterpretationVisitor.GetResultFromExpression(Expression exp)
at MiaPlaza.ExpressionUtils.Evaluating.ExpressionInterpreter.ExpressionInterpretationVisitor.GetResultFromUnary(UnaryExpression exp)
at MiaPlaza.ExpressionUtils.ExpressionResultVisitor`1.DispatchVisitor.VisitUnary(UnaryExpression node)
at System.Linq.Expressions.UnaryExpression.Accept(ExpressionVisitor visitor)
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
at MiaPlaza.ExpressionUtils.ExpressionResultVisitor`1.GetResultFromExpression(Expression expression)
at MiaPlaza.ExpressionUtils.Evaluating.ExpressionInterpreter.ExpressionInterpretationVisitor.GetResultFromExpression(Expression exp)
at MiaPlaza.ExpressionUtils.Evaluating.ExpressionInterpreter.Interpret(Expression exp)
--- End of inner exception stack trace ---
at MiaPlaza.ExpressionUtils.Evaluating.ExpressionInterpreter.Interpret(Expression exp)
at MiaPlaza.ExpressionUtils.Evaluating.ExpressionInterpreter.MiaPlaza.ExpressionUtils.Evaluating.IExpressionEvaluator.Evaluate(Expression unparametrizedExpression)
at MiaPlaza.ExpressionUtils.PartialEvaluator.SubtreeEvaluator.Visit(Expression exp)).Invoke()```
E.g. in ParameterSubstituter
exceptions are used for the program flow. This is in general considered bad practice and especially annoying when debugging since those exceptions will result in a context switch which is very expensive (slow).
@Khazuar can you add more people on nuget to be maintainers of this so that we could upload updates there?
says 1.1.0 there but should be 1.1.2.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.