예제 #1
0
 public static void CheckUserParamsZero(TotemFunction function, object sequence)
 {
     var t = sequence.GetType();
     if (typeof(IList).IsAssignableFrom(t))
         throw ValueError("Not a list type");
     IList l = (IList)sequence;
     if (l.Count != 0)
     {
         throw function.BadArgumentError(l.Count + function.NormalArgumentCount);
     }
 }
예제 #2
0
        public static object ExtractParamsArgument(TotemFunction function, int argCnt, TotemArray list)
        {
            if (list.Count != 0)
                return list.Shift();

            throw function.BadArgumentError(argCnt);
        }
예제 #3
0
 public static void CheckParamsZero(TotemFunction function, List<object> extraArgs)
 {
     if (extraArgs.Count != 0)
     {
         throw function.BadArgumentError(extraArgs.Count + function.NormalArgumentCount);
     }
 }
예제 #4
0
 public static Exception FunctionBadArgumentError(TotemFunction function, int count)
 {
     return function.BadArgumentError(count);
 }