コード例 #1
0
ファイル: POrIsEq.cs プロジェクト: NotJRM/jrm-code-project
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.rand0);
            rand0TypeHistogram.Note (this.rand0Type);
            SCode.location = "POrIsEqXS.EvalStep";
            #endif
            object ev1;
            if (environment.StaticValue (out ev1, this.rand1Name, this.rand1Offset))
                throw new NotImplementedException ();

            Control unev = this.rand0;
            Environment env = environment;
            object ev0;
            while (unev.EvalStep (out ev0, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "POrXS.EvalStep";
            #endif
            if (ev0 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveCombination1Frame0 (this, environment));
                //answer = Interpreter.UnwindStack;
                //environment = env;
                //return false;
            }

            if (! ObjectModel.SchemeEq (ev0, ev1)) {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.alternative);
                alternativeTypeHistogram.Note (this.alternativeType);
                SCode.location = "POrIsEqXS.EvalStep";
            #endif
                expression = this.alternative;
                answer = null; //happy compiler
                return true;
            }
            else {
                answer = Constant.sharpT;
                return false;
                }
        }
コード例 #2
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("PrimitiveStringSetSQQ");
            #endif
            object ev0;
            if (environment.StaticValue (out ev0, this.rand0Name, this.rand0Offset))
                throw new NotImplementedException ();

            object ev1 = this.rand1Value;
            object ev2 = this.rand2Value;
            answer = ((char []) ev0) [(int) ev1];
            ((char []) ev0) [(int) ev1] = (char) ev2;
            return false;
        }
コード例 #3
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.arg0);
            arg0TypeHistogram.Note (this.arg0Type);
            SCode.location = "PCondIsNullXXS";
            #endif
            Control unev0 = this.arg0;
            Environment env = environment;
            object ev0;
            while (unev0.EvalStep (out ev0, ref unev0, ref env)) { };
            #if DEBUG
            SCode.location = "PCondIsNullXXS";
            #endif
            if (ev0 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveIsNullFrame0 (this, closureEnvironment));
                //answer = Interpreter.Unwind;
                //closureEnvironment = env;
                //return false;
            }

            if (ev0 == null) {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.consequent);
                consequentTypeHistogram.Note (this.consequentType);
                SCode.location = "PCondIsNullXXS";
            #endif
                expression = this.consequent;
                answer = null; // keep c# compiler happy
                return true;
            }
            else {
                if (environment.StaticValue (out answer, this.alternativeName, this.alternativeOffset))
                    throw new NotImplementedException ();
                return false;
            }
        }
コード例 #4
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("PrimitiveGreaterThanFixnumA0S");
            #endif
            // Eval argument1
            object ev1;
            if (environment.StaticValue (out ev1, this.rand1Name, this.rand1Offset))
                throw new NotImplementedException ();

            // Eval argument0
            object ev0 = environment.Argument0Value;

            // Greater-than-fixnum?
            answer = (int) ev0 > (int) ev1 ? Constant.sharpT : Constant.sharpF;
            return false;
        }
コード例 #5
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            SCode.location = "PrimitiveRecordSetSQS";
            #endif
            object ev2;
            if (environment.StaticValue (out ev2, this.rand2Name, this.rand2Offset))
                throw new NotImplementedException ();

            object ev0;
            if (environment.StaticValue (out ev0, this.rand0Name, this.rand0Offset))
                throw new NotImplementedException ();

            answer = ((Record) ev0).Set (this.rand1Value, ev2);
            return false;
        }
コード例 #6
0
ファイル: PCond1.cs プロジェクト: NotJRM/jrm-code-project
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            procedureHistogram.Note (this.procedure);
            SCode.location = "PCond1A0XS";
            #endif
            object ev0 = environment.Argument0Value;

            #if DEBUG
            SCode.location = this.procedure.Name.ToString();
            Primitive.hotPrimitives.Note(this.procedure);
            #endif
            // It is expensive to bounce down to invoke the procedure
            // we invoke it directly and pass along the ref args.
            if (this.method (out answer, ev0)) {
                TailCallInterpreter tci = answer as TailCallInterpreter;
                if (tci != null) {
                    answer = null; // dispose of the evidence
                    // set up the interpreter for a tail call
                    Control cExpression = tci.Expression;
                    Environment cEnvironment = tci.Environment;
                    while (cExpression.EvalStep (out answer, ref cExpression, ref cEnvironment)) { };
                }
            }
            #if DEBUG
            SCode.location = "PCond1A0XS";
            #endif

            if ((answer is bool) && (bool) answer == false) {
                if (environment.StaticValue (out answer, this.alternativeName, this.alternativeOffset))
                    throw new NotImplementedException ();
                return false;
            }
            else {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.consequent);
                consequentTypeHistogram.Note (this.consequentType);
                SCode.location = "PCond1A0XQ";
            #endif
                expression = this.consequent;
                return true;
            }
        }
コード例 #7
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            SCode.location = "PCondLessThanFixnumSQ";
            #endif

            object ev0;
            if (environment.StaticValue (out ev0, this.rand0Name, this.rand0Offset))
                throw new NotImplementedException ();

            if ((int) ev0 < this.rand1Value) {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.consequent);
                consequentTypeHistogram.Note (this.consequentType);
                SCode.location = "PCondLessThanFixnumSQ";
            #endif
                expression = this.consequent;
                answer = null;
                return true;
            }
            else {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.alternative);
                alternativeTypeHistogram.Note (this.alternativeType);
                SCode.location = "PCondLessThanFixnumSQ";
            #endif
                expression = this.alternative;
                answer = null;
                return true;
            }
        }
コード例 #8
0
 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     #if DEBUG
     Warm ("PrimitiveRecordRefSQ");
     #endif
     object ev0;
     if (environment.StaticValue (out ev0, this.rand0Name, this.rand0Offset))
         throw new NotImplementedException ();
     // Eval argument0
     answer = ((Record) ev0).Ref (this.offset);
     return false;
 }
コード例 #9
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.rand1);
            rand1TypeHistogram.Note (this.rand1Type);
            SCode.location = "PCondRecordRefS";
            #endif
            Control unev = this.rand1;
            Environment env = environment;
            object ev1;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PCondRecordRefS";
            #endif
            if (ev1 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
            }

            object ev0;
            if (environment.StaticValue (out ev0, this.rand0Name, this.rand0Offset))
                throw new NotImplementedException ();

            object result = ((Record) ev0).Ref ((int) ev1);

            if (result is Boolean && (((bool) result) == false)) {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.alternative);
                alternativeTypeHistogram.Note (this.alternativeType);
                SCode.location = "PCondRecordRefS";
            #endif
                expression = this.alternative;
                answer = null;
                return true;
            }
            else {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.consequent);
                consequentTypeHistogram.Note (this.consequentType);
                SCode.location = "PCondRecordRefS";
            #endif
                expression = this.consequent;
                answer = null;
                return true;
            }
        }
コード例 #10
0
ファイル: PCond2.cs プロジェクト: NotJRM/jrm-code-project
        public override bool EvalStep (out object answer, ref Control expression, ref Environment environment)
        {
#if DEBUG
            Warm ("-");
            NoteCalls (this.rand1);
            procedureHistogram.Note (this.procedure);
            rand1TypeHistogram.Note (this.rand1Type);
            SCode.location = "PCond2SXQ";
#endif
            Control unev = this.rand1;
            Environment env = environment;
            object ev1;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
#if DEBUG
            SCode.location = "PCond2SXQ";
#endif
            if (ev1 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
            }

            object ev0;
            if (environment.StaticValue (out ev0, this.rand0Name, this.rand0Offset))
                throw new NotImplementedException ();

#if DEBUG
            SCode.location = this.procedure.Name.ToString ();
            Primitive.hotPrimitives.Note (this.procedure);
#endif
            // It is expensive to bounce down to invoke the procedure
            // we invoke it directly and pass along the ref args.
            if (this.method (out answer, ev0, ev1)) {
                TailCallInterpreter tci = answer as TailCallInterpreter;
                if (tci != null) {
                    answer = null; // dispose of the evidence
                    // set up the interpreter for a tail call
                    Control cExpression = tci.Expression;
                    Environment cEnvironment = tci.Environment;
                    while (cExpression.EvalStep (out answer, ref cExpression, ref cEnvironment)) { };
                }
            }
#if DEBUG
            SCode.location = "PCond2SXQ";
#endif
            if ((answer is bool) && (bool) answer == false) {
#if DEBUG
                NoteCalls (this.alternative);
                alternativeTypeHistogram.Note (this.alternativeType);
#endif
                expression = this.alternative;
                return true;
            }
            else {
                answer = this.consequentValue;
                return false;
            }
        }
コード例 #11
0
 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     #if DEBUG
     Warm ("PrimitiveRecordRefAS");
     #endif
     object ev1;
     if (environment.StaticValue (out ev1, this.rand1Name, this.rand1Offset))
         throw new NotImplementedException ();
     answer = ((Record) environment.ArgumentValue(this.rand0Offset)).Ref ((int) ev1);
     return false;
 }
コード例 #12
0
 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     #if DEBUG
     Warm ("PrimitiveVector8BRefSS");
     #endif
     object ev1;
     if (environment.StaticValue (out ev1, this.rand1Name, this.rand1Offset))
         throw new NotImplementedException ();
     object ev0;
     if (environment.StaticValue (out ev0, this.rand0Name, this.rand0Offset))
         throw new NotImplementedException ();
     // Vector-8b-ref
     answer = (int) ((char []) ev0) [(int) ev1];
     return false;
 }
コード例 #13
0
 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     #if DEBUG
     Warm ("PrimitiveVector8BRefS");
     NoteCalls (this.rand1);
     #endif
     object ev0;
     if (environment.StaticValue (out ev0, this.rand0Name, this.rand0Offset))
         throw new NotImplementedException ();
     throw new NotImplementedException ();
 }
コード例 #14
0
ファイル: POrIsEq.cs プロジェクト: NotJRM/jrm-code-project
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            SCode.location = "POrIsEqAS.EvalStep";
            #endif

            object ev1;
            if (environment.StaticValue (out ev1, this.rand1Name, this.rand1Offset))
                throw new NotImplementedException ();
            object ev0 = environment.ArgumentValue (this.rand0Offset);

            if (! ObjectModel.SchemeEq (ev0, ev1)) {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.alternative);
                alternativeTypeHistogram.Note (this.alternativeType);
                SCode.location = "POrIsEqAS.EvalStep";
            #endif
                expression = this.alternative;
                answer = null; //happy compiler
                return true;
            }
            else {
                answer = Constant.sharpT;
                return false;
                }
        }
コード例 #15
0
 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     #if DEBUG
     Warm ("PrimitiveIsEqAS");
     #endif
     object ev1;
     if (environment.StaticValue (out ev1, this.rand1Name, this.rand1Offset))
         throw new NotImplementedException ();
     if (ObjectModel.Eq (out answer, environment.ArgumentValue (this.rand0Offset), ev1))
         throw new NotImplementedException ();
     return false;
 }
コード例 #16
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("PCondRecordRefSQXA0");
            #endif

            object ev0;
            if (environment.StaticValue (out ev0, this.rand0Name, this.rand0Offset))
                throw new NotImplementedException ();

            object result = ((Record) ev0).Ref (this.rand1Value);

            if (result is Boolean && (((bool) result) == false)) {
                answer = environment.Argument0Value;
                return false;
            }
            else {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.consequent);
                consequentTypeHistogram.Note (this.consequentType);
                SCode.location = "PCondRecordRefSQXA0";
            #endif
                expression = this.consequent;
                answer = null;
                return true;
            }
        }
コード例 #17
0
ファイル: PCond1.cs プロジェクト: NotJRM/jrm-code-project
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.arg0);
            procedureHistogram.Note (this.procedure);
            arg0TypeHistogram.Note (this.arg0Type);
            SCode.location = "PCond1XXS";
            #endif
            Control unev0 = this.arg0;
            Environment env = environment;
            object ev0;
            while (unev0.EvalStep (out ev0, ref unev0, ref env)) { };
            #if DEBUG
            SCode.location = "PCond1XXS";
            #endif
            if (ev0 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveCombination1Frame0 (this, closureEnvironment));
                //answer = Interpreter.Unwind;
                //closureEnvironment = env;
                //return false;
            }

            #if DEBUG
            SCode.location = this.procedure.Name.ToString();
            Primitive.hotPrimitives.Note(this.procedure);
            #endif
            // It is expensive to bounce down to invoke the procedure
            // we invoke it directly and pass along the ref args.
            if (this.method (out answer, ev0)) {
                TailCallInterpreter tci = answer as TailCallInterpreter;
                if (tci != null) {
                    answer = null; // dispose of the evidence
                    // set up the interpreter for a tail call
                    Control cExpression = tci.Expression;
                    Environment cEnvironment = tci.Environment;
                    while (cExpression.EvalStep (out answer, ref cExpression, ref cEnvironment)) { };
                }
            }
            #if DEBUG
            SCode.location = "PCond1XXS";
            #endif
            if ((answer is bool) && (bool) answer == false) {
                if (environment.StaticValue (out answer, this.alternativeName, this.alternativeOffset))
                    throw new NotImplementedException ();
                return false;
            }
            else {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.consequent);
                consequentTypeHistogram.Note (this.consequentType);
                SCode.location = "PCond1XXS";
            #endif
                expression = this.consequent;
                return true;
            }
        }
コード例 #18
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("PrimitiveIsEqCarA0CarS");
            #endif
            object ev1;
            if (environment.StaticValue (out ev1, this.rand1Name, this.rand1Offset))
                throw new NotImplementedException ();
            Cons ev1Pair = ev1 as Cons;
            if (ev1Pair == null) throw new NotImplementedException ();

            // Eval argument0
            Cons ev0Pair = environment.Argument0Value as Cons;
            if (ev0Pair == null) throw new NotImplementedException ();

            if (ObjectModel.Eq (out answer, ev0Pair.Car, ev1Pair.Car))
                throw new NotImplementedException ();
            return false;
        }
コード例 #19
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            SCode.location = "PCondIsEqCarA0S";
            #endif

            object ev1;
            if (environment.StaticValue (out ev1, this.rand1Name, this.rand1Offset))
                throw new NotImplementedException ();

            object ev0 = environment.Argument0Value;

            #if DEBUG
            SCode.location = "PCondIsEqCarA0S";
            #endif
            if (!ObjectModel.SchemeEq (((Cons)ev0).Car, ev1)) {
            #if DEBUG
                NoteCalls (this.alternative);
                alternativeTypeHistogram.Note (this.alternativeType);
            #endif
                expression = this.alternative;
                answer = null; // happy compiler
                return true;
            }
            else {
            #if DEBUG
                NoteCalls (this.consequent);
                consequentTypeHistogram.Note (this.consequentType);
            #endif
                expression = this.consequent;
                answer = null; // happy compiler
                return true;
            }
        }
コード例 #20
0
 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     #if DEBUG
     Warm ("PrimitiveIsCharEqQS");
     #endif
     object ev1;
     if (environment.StaticValue (out ev1, this.rand1Name, this.rand1Offset))
         throw new NotImplementedException ();
     //bool x = (ev1 is char);
     //bool y = (ev1 is Character);
     //if (x != y) Debugger.Break ();
     answer = ((ev1 is char) && (this.rand0Value == (char) ev1)) ? Constant.sharpT : Constant.sharpF;
     return false;
 }
コード例 #21
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            SCode.location = "PCondLessThanFixnumSXQ";
            #endif
            Control unev = this.rand1;
            Environment env = environment;
            object ev1;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PCondLessThanFixnumSXQ";
            #endif
            if (ev1 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
            }

            object ev0;
            if (environment.StaticValue (out ev0, this.rand0Name, this.rand0Offset))
                throw new NotImplementedException ();

            if ((int) ev0 < (int) ev1) {
                answer = this.consequentValue;
                return false;
            }
            else {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.alternative);
                alternativeTypeHistogram.Note (this.alternativeType);
                SCode.location = "PCondLessThanFixnumSXQ";
            #endif
                expression = this.alternative;
                answer = null;
                return true;
            }
        }
コード例 #22
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            SCode.location = "PrimitiveIsEqCarSS";
            #endif
            // Eval argument1
            object ev1;
            if (environment.StaticValue (out ev1, this.rand1Name, this.rand1Offset))
                throw new NotImplementedException ();

            // Eval argument0
            object ev0;
            if (environment.StaticValue (out ev0, this.rand0ArgName, this.rand0ArgOffset))
                throw new NotImplementedException ();
            Cons ev0Pair = ev0 as Cons;

            if (ev0Pair == null) throw new NotImplementedException ();

            if (ObjectModel.Eq (out answer, ev0Pair.Car, ev1))
                throw new NotImplementedException ();
            return false;
        }
コード例 #23
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.rand1);
            rand1TypeHistogram.Note (this.rand1Type);
            SCode.location = "PrimitiveGreaterThanFixnumS";
            #endif
            // Eval argument1
            object ev1;

            Control unev = this.rand1;
            Environment env = environment;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PrimitiveGreaterThanFixnumS";
            #endif
            if (ev1 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveCombination2Frame0 (this, environment));
                //answer = Interpreter.UnwindStack;
                //environment = env;
                //return false;
            }

            // Eval argument0
            object ev0;
            if (environment.StaticValue (out ev0, this.rand0Name, this.rand0Offset))
                throw new NotImplementedException ();

            // Greater-than-fixnum?
            answer = (int) ev0 > (int) ev1 ? Constant.sharpT : Constant.sharpF;
            return false;
        }
コード例 #24
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("PrimitiveIsEqSS");
            #endif
            // Eval argument1
            object ev1;
            if (environment.StaticValue (out ev1, this.rand1Name, this.rand1Offset))
                throw new NotImplementedException ();

            // Eval argument0
            object ev0;
            if (environment.StaticValue (out ev0, this.rand0Name, this.rand0Offset))
                throw new NotImplementedException ();

            return ObjectModel.Eq (out answer, ev0, ev1);
        }
コード例 #25
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.arg2);
            rand2TypeHistogram.Note (this.rand2Type);
            SCode.location = "PrimitiveStringSetSQ";
            #endif
            object ev2;
            Environment env = environment;
            Control unev = this.arg2;
            while (unev.EvalStep (out ev2, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PrimitiveStringSetSQ";
            #endif
            if (ev2 == Interpreter.UnwindStack) {
                ((UnwinderState) env).AddFrame (new PrimitiveCombination3Frame0 (this, environment));
                answer = Interpreter.UnwindStack;
                environment = env;
                return false;
            }

            object ev0;
            if (environment.StaticValue (out ev0, this.rand0Name, this.rand0Offset))
                throw new NotImplementedException ();

            object ev1 = this.rand1Value;
            answer = ((char []) ev0) [(int) ev1];
            ((char []) ev0) [(int) ev1] = (char) ev2;
            return false;
        }
コード例 #26
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.rand0);
            rand0TypeHistogram.Note (this.rand0Type);
            SCode.location = "PrimitiveIsEqXS";
            #endif
            // Eval argument1
            object ev1;
            if (environment.StaticValue (out ev1, this.rand1Name, this.rand1Offset))
                throw new NotImplementedException ();

            // Eval argument0
            object ev0;

            Control unev = this.rand0;
            Environment env = environment;
            while (unev.EvalStep (out ev0, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PrimitiveIsEqXS";
            #endif
            if (ev0 == Interpreter.UnwindStack) {
                throw new NotImplementedException ();
                //((UnwinderState) env).AddFrame (new PrimitiveCombination2Frame0 (this, environment));
                //answer = Interpreter.UnwindStack;
                //environment = env;
                //return false;
            }

            return ObjectModel.Eq (out answer, ev0, ev1);
        }
コード例 #27
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("PCondIsNullSXQ");
            #endif
            object ev0;
            if (environment.StaticValue (out ev0, this.predicateRandName, this.predicateRandOffset))
                throw new NotImplementedException ();

            if (ev0 == null) {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.consequent);
                consequentTypeHistogram.Note (this.consequentType);
                SCode.location = "PCondIsNullSXQ";
            #endif
                expression = this.consequent;
                answer = null; // keep c# compiler happy
                return true;
            }
            else {
                answer = this.alternativeValue;
                return false;
            }
        }
コード例 #28
0
 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     #if DEBUG
     Warm ("PrimitiveIsIntEqQS");
     #endif
     object that;
     if (environment.StaticValue (out that, this.rand1Name, this.rand1Offset))
         throw new NotImplementedException ();
     answer = ((that is int) && (this.rand0Value == (int) that));
     return false;
 }
コード例 #29
0
 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     #if DEBUG
     Warm ("PCondIsNullAS");
     #endif
     if (environment.ArgumentValue(this.predicateArgumentOffset) == null) {
         if (environment.StaticValue (out answer, this.consequentName, this.consequentOffset))
             throw new NotImplementedException ();
         return false;
     }
     else {
     #if DEBUG
         SCode.location = "-";
         NoteCalls (this.alternative);
         alternativeTypeHistogram.Note (this.alternativeType);
         SCode.location = "PCondIsNullAS";
     #endif
         expression = this.alternative;
         answer = null; // keep c# compiler happy
         return true;
     }
 }
コード例 #30
0
        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            SCode.location = "PrimitiveLessThanFixnumSQ";
            #endif
            // Eval argument0
            object ev0;
            if (environment.StaticValue (out ev0, this.rand0Name, this.rand0Offset))
                throw new NotImplementedException ();

            // less-than-fixnum?
            answer = (int) ev0 < this.rand1Value ? Constant.sharpT : Constant.sharpF;
            return false;
        }