diff src/luan/modules/TableLuan.java @ 1562:b89212fd04b5

remove table.luan
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 08 Nov 2020 16:50:59 -0700
parents 225808b90cee
children 8fbcc4747091
line wrap: on
line diff
--- a/src/luan/modules/TableLuan.java	Thu Nov 05 20:24:09 2020 -0700
+++ b/src/luan/modules/TableLuan.java	Sun Nov 08 16:50:59 2020 -0700
@@ -13,12 +13,12 @@
 
 public final class TableLuan {
 
-	public static String concat(LuanTable list,String sep,Integer i,Integer j) throws LuanException {
+	public static String concat(Luan luan,LuanTable list,String sep,Integer i,Integer j) throws LuanException {
 		int first = i==null ? 1 : i;
 		int last = j==null ? list.length() : j;
 		StringBuilder buf = new StringBuilder();
 		for( int k=first; k<=last; k++ ) {
-			Object val = list.get(k);
+			Object val = list.get(luan,k);
 			if( val==null )
 				break;
 			if( sep!=null && k > first )
@@ -82,24 +82,24 @@
 		}
 	}
 
-	public static LuanTable pack(Luan luan,Object... args) throws LuanException {
-		LuanTable tbl = new LuanTable(luan,Arrays.asList(args));
+	public static LuanTable pack(Object... args) throws LuanException {
+		LuanTable tbl = new LuanTable(Arrays.asList(args));
 		tbl.rawPut( "n", args.length );
 		return tbl;
 	}
 
-	public static Object[] unpack(LuanTable tbl,Integer iFrom,Integer iTo) throws LuanException {
+	public static Object[] unpack(Luan luan,LuanTable tbl,Integer iFrom,Integer iTo) throws LuanException {
 		int from = iFrom!=null ? iFrom : 1;
 		int to;
 		if( iTo != null ) {
 			to = iTo;
 		} else {
-			Integer n = Luan.asInteger( tbl.get("n") );
+			Integer n = Luan.asInteger( tbl.get(luan,"n") );
 			to = n!=null ? n : tbl.length();
 		}
 		List<Object> list = new ArrayList<Object>();
 		for( int i=from; i<=to; i++ ) {
-			list.add( tbl.get(i) );
+			list.add( tbl.get(luan,i) );
 		}
 		return list.toArray();
 	}