comparison src/luan/modules/TableLuan.java @ 1420:225808b90cee

options handling
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 26 Oct 2019 22:21:09 -0600
parents e0cf0d108a77
children b89212fd04b5
comparison
equal deleted inserted replaced
1419:59fd2e8b1b9d 1420:225808b90cee
37 } 37 }
38 38
39 public static Object remove(LuanTable list,int pos) throws LuanException { 39 public static Object remove(LuanTable list,int pos) throws LuanException {
40 if( list.getMetatable() != null ) 40 if( list.getMetatable() != null )
41 throw new LuanException("can't remove from a table with a metatable"); 41 throw new LuanException("can't remove from a table with a metatable");
42 return list.rawRemove(pos); 42 return list.removeFromList(pos);
43 } 43 }
44 44
45 private static interface LessThan { 45 private static interface LessThan {
46 public boolean isLessThan(Object o1,Object o2); 46 public boolean isLessThan(Object o1,Object o2);
47 } 47 }
119 public static int hash_value(LuanTable tbl) throws LuanException { 119 public static int hash_value(LuanTable tbl) throws LuanException {
120 return tbl.hashValue(); 120 return tbl.hashValue();
121 } 121 }
122 122
123 public static boolean is_empty(LuanTable tbl) throws LuanException { 123 public static boolean is_empty(LuanTable tbl) throws LuanException {
124 return tbl.rawIsEmpty(); 124 return tbl.isEmpty();
125 } 125 }
126 126
127 public static int size(LuanTable tbl) throws LuanException { 127 public static int size(LuanTable tbl) throws LuanException {
128 return tbl.rawSize(); 128 return tbl.rawSize();
129 } 129 }