diff core/src/luan/modules/TableLuan.java @ 565:22bfd8a2eaee

do Table documentation; replace Table.clone and Table.sub_list with Table.copy;
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 05 Jul 2015 00:47:00 -0600
parents bf5e62a9090c
children f1601a4ce1aa
line wrap: on
line diff
--- a/core/src/luan/modules/TableLuan.java	Sat Jul 04 20:57:24 2015 -0600
+++ b/core/src/luan/modules/TableLuan.java	Sun Jul 05 00:47:00 2015 -0600
@@ -100,16 +100,14 @@
 		return list.toArray();
 	}
 
-	public static LuanTable sub_list(LuanState luan,LuanTable list,int from,int to) throws LuanException {
-		if( list.getMetatable() != null )
-			throw luan.exception("can't sub_list a table with a metatable");
+	public static LuanTable copy(LuanTable list,Integer from,Integer to) {
+		if( from == null )
+			return new LuanTable(list);
+		if( to == null )
+			to = list.rawLength();
 		return list.rawSubList(from,to);
 	}
 
-	public static LuanTable clone(LuanTable tbl) {
-		return new LuanTable(tbl);
-	}
-
 	public static LuanTable new_property_table() {
 		return LuanPropertyMeta.INSTANCE.newTable();
 	}