![]() | IEvaluatorClone Method |
This method returns a freshly initialized copy of the IEvaluator. The cloning 'depth' can be controlled by the copyRefAssemblies.
This method is a convenient technique when multiple IEvaluator instances are required (e.g. for concurrent script evaluation).
Namespace: CSScriptLib
IEvaluator Clone( bool copyRefAssemblies = true )
var eval1 = CSScript.Evaluator.Clone(); var eval2 = CSScript.Evaluator.Clone(); var sub = eval1.LoadDelegate<Func<int, int, int>>( @"int Sub(int a, int b) { return a - b; }"); var sum = eval2.LoadDelegate<Func<int, int, int>>( @"int Sub(int a, int b) { return a + b; }"); var result = sum(7, sub(4,2));