comparison core/src/luan/modules/StringLuan.java @ 409:abce9b0041b0

remove LuanState.require(), eval() is good enough
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 29 Apr 2015 15:26:54 -0600
parents d55e873e1f0d
children e9d4d5854e54
comparison
equal deleted inserted replaced
408:1b38de2b1845 409:abce9b0041b0
13 13
14 14
15 public final class StringLuan { 15 public final class StringLuan {
16 16
17 public static Object __index(LuanState luan,final String s,Object key) throws LuanException { 17 public static Object __index(LuanState luan,final String s,Object key) throws LuanException {
18 LuanTable mod = (LuanTable)luan.require("luan:String"); 18 LuanTable mod = (LuanTable)PackageLuan.require(luan,"luan:String");
19 Object obj = mod.get(key); 19 Object obj = mod.get(key);
20 if( obj instanceof LuanFunction ) { 20 if( obj instanceof LuanFunction ) {
21 final LuanFunction fn = (LuanFunction)obj; 21 final LuanFunction fn = (LuanFunction)obj;
22 return new LuanFunction() { 22 return new LuanFunction() {
23 @Override public Object call(LuanState luan,Object[] args) throws LuanException { 23 @Override public Object call(LuanState luan,Object[] args) throws LuanException {