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); } }
public static object ExtractParamsArgument(TotemFunction function, int argCnt, TotemArray list) { if (list.Count != 0) return list.Shift(); throw function.BadArgumentError(argCnt); }
public static void CheckParamsZero(TotemFunction function, List<object> extraArgs) { if (extraArgs.Count != 0) { throw function.BadArgumentError(extraArgs.Count + function.NormalArgumentCount); } }
public static Exception FunctionBadArgumentError(TotemFunction function, int count) { return function.BadArgumentError(count); }