Mercurial Hosting > luan
comparison src/luan/modules/TableLuan.java @ 1708:8d257d56dc42
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 04 Jul 2022 14:06:59 -0600 |
parents | 19df8abc9805 |
children |
comparison
equal
deleted
inserted
replaced
1707:ad5647031343 | 1708:8d257d56dc42 |
---|---|
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.removeFromList(pos); | 42 try { |
43 return list.removeFromList(pos); | |
44 } catch(IndexOutOfBoundsException e) { | |
45 throw new LuanException("index out of bounds - index="+pos+" length="+list.rawLength()); | |
46 } | |
43 } | 47 } |
44 | 48 |
45 private static interface LessThan { | 49 private static interface LessThan { |
46 public boolean isLessThan(Object o1,Object o2); | 50 public boolean isLessThan(Object o1,Object o2); |
47 } | 51 } |