当前位置: 首页>>代码示例>>C#>>正文


C# Environment.ArgumentValue方法代码示例

本文整理汇总了C#中System.Environment.ArgumentValue方法的典型用法代码示例。如果您正苦于以下问题:C# Environment.ArgumentValue方法的具体用法?C# Environment.ArgumentValue怎么用?C# Environment.ArgumentValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Environment的用法示例。


在下文中一共展示了Environment.ArgumentValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EvalStep

        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("PCond2A.EvalStep");
            #endif
            object ev1;
            Control unev = this.rand1;
            Environment env = environment;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
            if (ev1 == Interpreter.UnwindStack) {
                throw new NotImplementedException();
            }

            #if DEBUG
            Primitive.hotPrimitives.Note (this.procedure);
            #endif
            if (this.method (out answer, environment.ArgumentValue (this.rand0Offset), 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 ((answer is bool) && (bool) answer == false) {
            #if DEBUG
                noteCalls (this.alternative);
            #endif
                expression = this.alternative;
                return true;
            }
            else {
            #if DEBUG
                noteCalls (this.consequent);
            #endif
                expression = this.consequent;
                return true;
            }
        }
开发者ID:NotJRM,项目名称:jrm-code-project,代码行数:42,代码来源:PCond2e.cs

示例2: EvalStep

 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     #if DEBUG
     Warm ("PCondIsFixnumA1AQ.EvalStep");
     #endif
     if ((int) environment.Argument1Value == (int) environment.ArgumentValue (this.rand1Offset)) {
         answer = this.consequentValue;
         return false;
     }
     else {
     #if DEBUG
         noteCalls (this.alternative);
         alternativeTypeHistogram.Note (this.alternativeType);
     #endif
         expression = this.alternative;
         answer = null;
         return true;
     }
 }
开发者ID:NotJRM,项目名称:jrm-code-project,代码行数:19,代码来源:PCondIsFixnumEqual.cs

示例3: EvalStep

 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;
     }
 }
开发者ID:NotJRM,项目名称:jrm-code-project,代码行数:22,代码来源:PCondIsNull.cs

示例4: EvalStep

        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            NoteCalls (this.arg1);
            NoteCalls (this.arg2);
            rand1TypeHistogram.Note (this.rand1Type);
            rand2TypeHistogram.Note (this.rand2Type);
            SCode.location = "PrimitiveStringSetA";
            #endif
            object ev2;
            Environment env = environment;
            Control unev = this.arg2;
            while (unev.EvalStep (out ev2, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PrimitiveStringSetA";
            #endif
            if (ev2 == Interpreter.UnwindStack) {
                ((UnwinderState) env).AddFrame (new PrimitiveCombination3Frame0 (this, environment));
                answer = Interpreter.UnwindStack;
                environment = env;
                return false;
            }

            object ev1;
            env = environment;
            unev = this.arg1;
            while (unev.EvalStep (out ev1, ref unev, ref env)) { };
            #if DEBUG
            SCode.location = "PrimitiveStringSetA";
            #endif
            if (ev1 == Interpreter.UnwindStack) {
                ((UnwinderState) env).AddFrame (new PrimitiveCombination3Frame1 (this, environment, ev2));
                answer = Interpreter.UnwindStack;
                environment = env;
                return false;
            }

            object ev0 = environment.ArgumentValue (this.rand0Offset);
            answer = ((char []) ev0) [(int) ev1];
            ((char []) ev0) [(int) ev1] = (char) ev2;
            return false;
        }
开发者ID:NotJRM,项目名称:jrm-code-project,代码行数:43,代码来源:PrimitiveStringSet.cs

示例5: EvalStep

        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #region EvalStepBody
            #if DEBUG
            Warm ();

            #endif
            object ev0 = environment.ArgumentValue (this.predicateOffset);

            if (!(ev0 is Symbol)) {
            #if DEBUG
                noteCalls (this.alternative);

            #endif
                expression = this.alternative;
                answer = null;
                return true;
            }
            else {
                if (environment.FastLexicalRef (out answer, this.consequentName, this.consequentDepth, this.consequentOffset))
                    throw new NotImplementedException ();
                return false;
            }
            #endregion
        }
开发者ID:NotJRM,项目名称:jrm-code-project,代码行数:25,代码来源:PCondIsSymbol.cs

示例6: EvalStep

 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     #if DEBUG
     Warm ("PCondIsObjectEqAQQx.EvalStep");
     #endif
     object arg = environment.ArgumentValue (this.rand0Offset);
     answer = (arg == this.rand1Value) ? consequentValue : arg;
     return false;
 }
开发者ID:NotJRM,项目名称:jrm-code-project,代码行数:9,代码来源:PCondIsObjectEq.cs

示例7: EvalStep

        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            SCode.location = "PCond2A0L1L1A.EvalStep";
            #endif
            object ev1;
            if (environment.FastLexicalRef1 (out ev1, this.rand1Name, this.rand1Offset))
                throw new NotImplementedException ();

            #if DEBUG
            Primitive.hotPrimitives.Note (this.procedure);
            #endif
            if (this.method (out answer, environment.Argument0Value, 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 ((answer is bool) && (bool) answer == false) {
                answer = environment.ArgumentValue(this.alternativeOffset);
                return false;
            }
            else {
                if (environment.FastLexicalRef1 (out answer, this.consequentName, this.consequentOffset))
                    throw new NotImplementedException ();
                return false;
            }
        }
开发者ID:NotJRM,项目名称:jrm-code-project,代码行数:34,代码来源:PCond2f.cs

示例8: EvalStep

 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     #if DEBUG
     Warm ("PrimitiveIsObjectEqAQ.EvalStep");
     #endif
     answer = (environment.ArgumentValue(this.rand0Offset) == this.rand1Value) ? Constant.sharpT : Constant.sharpF;
     return false;
 }
开发者ID:NotJRM,项目名称:jrm-code-project,代码行数:8,代码来源:PrimitiveIsObjectEq.cs

示例9: EvalStep

        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            procedureHistogram.Note (this.procedure);
            SCode.location = "PCond1A0XA";
            #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 = "PCond1A0XA";
            #endif

            if ((answer is bool) && (bool) answer == false) {
                answer = environment.ArgumentValue (this.alternativeOffset);
                return false;
            }
            else {
            #if DEBUG
                SCode.location = "-";
                NoteCalls (this.consequent);
                consequentTypeHistogram.Note (this.consequentType);
                SCode.location = "PCond1A0XA";
            #endif
                expression = this.consequent;
                return true;
            }
        }
开发者ID:NotJRM,项目名称:jrm-code-project,代码行数:44,代码来源:PCond1.cs

示例10: EvalStep

        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("-");
            SCode.location = "PCond2A1QQQ.EvalStep";
            Primitive.hotPrimitives.Note (this.procedure);
            SCode.location = this.procedure.Name.ToString();
            #endif
            object predValue;

            if (this.method (out predValue, environment.ArgumentValue (this.rand0Offset), this.rand1Value)) {
                TailCallInterpreter tci = predValue as TailCallInterpreter;
                if (tci != null) {
                    answer = null;
                    expression = tci.Expression;
                    environment = tci.Environment;
                    return true;
                }
                else
                    throw new NotImplementedException ();
            }

            if (predValue is bool && (bool) predValue == false) {
                answer = this.alternativeValue;
                return false;
            }
            else {
            #if DEBUG
                noteCalls (this.consequent);
            #endif
                expression = this.consequent;
                answer = null;
                return true;
            }
        }
开发者ID:NotJRM,项目名称:jrm-code-project,代码行数:35,代码来源:PCond2g.cs

示例11: EvalStep

        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #if DEBUG
            Warm ("PrimitivePlusFixnumAQ.EvalStep");
            #endif
            // Eval argument1
            int ev1 = this.rand1Value;

            // Eval argument0
            object ev0 = environment.ArgumentValue(this.rand0Offset);

            // Compute answer
            answer = (int) ev0 + ev1;
            return false;
        }
开发者ID:NotJRM,项目名称:jrm-code-project,代码行数:15,代码来源:PrimitivePlusFixnum.cs

示例12: EvalStep

 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     #if DEBUG
     Warm ("PrimitiveIsFixnumEqualAL.EvalStep");
     #endif
     object ev1;
     if (environment.FastLexicalRef (out ev1, this.rand1Name, this.rand1Depth, this.rand1Offset))
         throw new NotImplementedException ();
     object ev0 = environment.ArgumentValue (this.rand0Offset);
     answer = ((int) ev0 == (int) ev1) ? Constant.sharpT : Constant.sharpF;
     return false;
 }
开发者ID:NotJRM,项目名称:jrm-code-project,代码行数:12,代码来源:PrimitiveIsFixnumEqual.cs

示例13: EvalStep

        public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
        {
            #region EvalStepBody
            #if DEBUG
            Warm ();
            noteCalls (this.arg0);
            #endif
            object ev0 = environment.ArgumentValue (this.predicateOffset);

            if (!(ev0 is Complex)) {
            #if DEBUG
                noteCalls (this.alternative);
            #endif
                expression = this.alternative;
                answer = null;
                return true;
            }
            else {
                answer = this.consequentValue;
                return false;
            }
            #endregion
        }
开发者ID:NotJRM,项目名称:jrm-code-project,代码行数:23,代码来源:PCondIsComplex.cs

示例14: EvalStep

        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 = "PrimitiveGreaterThanFixnumA";
            #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 = "PrimitiveGreaterThanFixnumA";
            #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 = environment.ArgumentValue (this.rand0Offset);

            // Greater-than-fixnum?
            answer = (int) ev0 > (int) ev1 ? Constant.sharpT : Constant.sharpF;
            return false;
        }
开发者ID:NotJRM,项目名称:jrm-code-project,代码行数:32,代码来源:PrimitiveGreaterThanFixnum.cs

示例15: EvalStep

 public override bool EvalStep(out object answer, ref Control expression, ref Environment environment)
 {
     #if DEBUG
     Warm ("PrimitiveIsCharEqQA.EvalStep");
     #endif
     object ev1 = environment.ArgumentValue (this.rand1Offset);
     answer = (ev1 is char && ((char) ev1 == this.rand0Value)) ? Constant.sharpT : Constant.sharpF;
     return false;
 }
开发者ID:NotJRM,项目名称:jrm-code-project,代码行数:9,代码来源:PrimitiveIsCharEq.cs


注:本文中的System.Environment.ArgumentValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。