Source/Simulator/Common/Runtime/VirtualMachine.cs
/// <summary>
/// Execute a lambda defined in _scope
/// </summary>
Execute a lambda defined in _scope
Execute a lambda defined in _scope
public object Execute(Lambda lambda, params object[] arguments)
		{
			var bodyEnv = new Environment(_scope);
			var bodyClosure = new ScopeClosure(bodyEnv, _reflection);
			bodyEnv.Bind(lambda.Signature.Parameters, arguments);
			foreach (var b in lambda.LocalVariables)
				bodyEnv.Bind(b.Variable, bodyClosure.Evaluate(b.Expression));
			return bodyClosure.Execute(lambda.Statements);
		}
public object Execute ( Lambda lambda , params object [ ] arguments ) { var bodyEnv = new Environment ( _scope ) ; var bodyClosure = new ScopeClosure ( bodyEnv , _reflection ) ; bodyEnv . Bind ( lambda . Signature . Parameters , arguments ) ; foreach ( var b in lambda . LocalVariables ) bodyEnv . Bind ( b . Variable , bodyClosure . Evaluate ( b . Expression ) ) ; return bodyClosure . Execute ( lambda . Statements ) ; }
Execute a lambda defined in _scope
Execute a lambda defined in _scope
lambda
Lambda