示例#1
0
        IComparable /*?*/[] ConvertTermArgumentsToMethodArguments(InterpretationContext c, Sequence <Term> termArguments, out IComparable thisArg)
        {
            int nMethodArgs = this.method.parameterInfos.Length;

            IComparable /*?*/[] methodArgs = new IComparable[nMethodArgs];
            thisArg = null;

            int k = 0;
            int nParametersUsed = this.inputArgumentIndices.Length;

            foreach (Term arg in termArguments)
            {
                if (k >= nParametersUsed)
                {
                    break;
                }

                int         methodArgIndex    = this.inputArgumentIndices[k++];
                IComparable argInterpretation = c.InterpretTerm(arg);  // convert from term to .NET runtime object

                if (-1 == methodArgIndex)
                {
                    thisArg = argInterpretation;
                }
                else if (methodArgIndex >= 0)
                {
                    methodArgs[methodArgIndex] = argInterpretation;
                }
            }
            return(methodArgs);
        }