Ejemplo n.º 1
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.rator);
            SCode.location = "StaticLet2QQ";
            #endif
            object ev1 = this.rand1Value;
            object ev0 = this.rand0Value;

            object [] cells = environment.GetValueCells (this.lambda.StaticMapping);
            #if DEBUG
            SCode.location = "StaticLet2QQ";
            #endif
            // StaticClosure cl = new StaticClosure ((StaticLambda) this.rator, environment);
            StaticClosure cl = new StaticClosure (this.lambda, environment.BaseEnvironment, cells);

            expression = this.body;
            environment = new StaticEnvironment (cl, new object [] { ev0, ev1 });
            answer = null;
            return true;
        }
Ejemplo n.º 2
0
 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     #if DEBUG
     Warm ("StaticLambda");
     #endif
     this.closeCount += 1;
     object [] cells = environment.GetValueCells (this.staticMapping);
     #if DEBUG
     SCode.location = "StaticLambda";
     #endif
     answer = new StaticClosure (this, environment.BaseEnvironment, cells);
     return false;
 }
Ejemplo n.º 3
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.rator);
            NoteCalls (this.rand1);
            rand1TypeHistogram.Note (this.rand1Type);
            SCode.location = "StaticLet2Q";
            #endif
            object ev1;
            Environment env = environment;
            Control unev = this.rand1;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "StaticLet2Q";
            #endif
            if (ev1 == Interpreter.UnwindStack) {
                ((UnwinderState) env).AddFrame (new Combination2Frame0 (this, environment));
                environment = env;
                answer = Interpreter.UnwindStack;
                return false;
            }

            object ev0 = this.rand0Value;

            object [] cells = environment.GetValueCells (this.lambda.StaticMapping);
            #if DEBUG
            SCode.location = "StaticLet2Q";
            #endif
            // StaticClosure cl = new StaticClosure ((StaticLambda) this.rator, environment);
            StaticClosure cl = new StaticClosure (this.lambda, environment.BaseEnvironment, cells);

            expression = this.body;
            environment = new StaticEnvironment (cl, new object [] { ev0, ev1 });
            answer = null;
            return true;
        }