Exemplo n.º 1
0
        public override int Eval(REnv env, FEnv fenv)
        {
            int        value  = 0;
            List <int> values = new List <int>();

            foreach (var expression in expressions)
            {
                int argValue = expression.Eval(env, fenv);
                values.Add(argValue);
            }
            FuncDef fDef = fenv.getFunction(fName);

            value = fDef.Eval(env, fenv, values);
            return(value);
        }
        public override int Eval(REnv env, FEnv fenv)
        {
            int[] argValues;

            if (args.Count > 0)
            {
                int index = 0;
                argValues = new int[args.Count];
                foreach (Expression arg in args)
                {
                    argValues[index++] = arg.Eval(env, fenv);
                }
            }
            else
            {
                argValues = new int[0];
            }
            FuncDef fDef = fenv.getFunction(fName);

            return(fDef.Eval(env, fenv, argValues));
        }