Mercurial Hosting > luan
comparison 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 |
comparison
equal
deleted
inserted
replaced
564:c8d4d69c6dd4 | 565:22bfd8a2eaee |
---|---|
98 list.add( tbl.get(luan,i) ); | 98 list.add( tbl.get(luan,i) ); |
99 } | 99 } |
100 return list.toArray(); | 100 return list.toArray(); |
101 } | 101 } |
102 | 102 |
103 public static LuanTable sub_list(LuanState luan,LuanTable list,int from,int to) throws LuanException { | 103 public static LuanTable copy(LuanTable list,Integer from,Integer to) { |
104 if( list.getMetatable() != null ) | 104 if( from == null ) |
105 throw luan.exception("can't sub_list a table with a metatable"); | 105 return new LuanTable(list); |
106 if( to == null ) | |
107 to = list.rawLength(); | |
106 return list.rawSubList(from,to); | 108 return list.rawSubList(from,to); |
107 } | |
108 | |
109 public static LuanTable clone(LuanTable tbl) { | |
110 return new LuanTable(tbl); | |
111 } | 109 } |
112 | 110 |
113 public static LuanTable new_property_table() { | 111 public static LuanTable new_property_table() { |
114 return LuanPropertyMeta.INSTANCE.newTable(); | 112 return LuanPropertyMeta.INSTANCE.newTable(); |
115 } | 113 } |