Len() public static method

public static Len ( object arg ) : int
arg object
return int
Example #1
0
        public static Expression[] CompileArgsX(object args, ParameterInfo[] p, Environment environment)
        {
            int l = 0;

            if (args is Pair)
            {
                l = Runtime.Len(args);
            }


            Expression[] es  = new Expression[l];
            object       foo = args;

            for (int i = 0; i < l; i++)
            {
                es[i] = Compile1(((Pair)foo).First(), environment);

                if (es[i].Type != p[i].ParameterType)
                {
                    es[i] = Expression.Convert(es[i], p[i].ParameterType);
                }

                foo = ((Pair)foo).Rest();
            }
            return(es);
        }
Example #2
0
        public static Expression[] CompileArgs1(object args, Environment environment)
        {
            int l = 0;

            if (args is Pair)
            {
                l = Runtime.Len(args);
            }


            Expression[] es  = new Expression[l];
            object       foo = args;

            for (int i = 0; i < l; i++)
            {
                es[i] = Expression.Convert(Compile1(((Pair)foo).First(), environment), typeof(object));
                foo   = ((Pair)foo).Rest();
            }
            return(es);
        }