static IEnumerable <object> select(ILuaValue index, params object[] args) { if (index.Equals("#")) { return(new object[] { args.Length }); } else if (index.ValueType == LuaValueType.Number) { double ind = index.AsDouble() ?? 0; if (ind < 0) { ind = args.Length + ind + 1; } return(args.Skip((int)(ind - 1))); } else { throw new ArgumentException( "First argument to function 'select' must be a number or the string '#'."); } }
static IEnumerable<object> select(ILuaValue index, params object[] args) { if (index.Equals("#")) { return new object[] { args.Length }; } else if (index.ValueType == LuaValueType.Number) { double ind = index.AsDouble() ?? 0; if (ind < 0) ind = args.Length + ind + 1; return args.Skip((int)(ind - 1)); } else { throw new ArgumentException( "First argument to function 'select' must be a number or the string '#'."); } }