Mercurial Hosting > luan
diff src/luan/lib/MathLib.java @ 108:3c404a296995
make Package module more standard;
return _ENV by default;
add "import" statement;
git-svn-id: https://luan-java.googlecode.com/svn/trunk@109 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 23 May 2014 03:21:54 +0000 |
parents | 7b15f56660fa |
children | f5af13062b10 |
line wrap: on
line diff
--- a/src/luan/lib/MathLib.java Mon May 19 09:17:57 2014 +0000 +++ b/src/luan/lib/MathLib.java Fri May 23 03:21:54 2014 +0000 @@ -3,7 +3,6 @@ import luan.LuanState; import luan.LuanTable; import luan.LuanFunction; -import luan.LuanLoader; import luan.LuanJavaFunction; @@ -11,8 +10,8 @@ public static final String NAME = "Math"; - public static final LuanLoader LOADER = new LuanLoader() { - @Override protected void load(LuanState luan) { + public static final LuanFunction LOADER = new LuanFunction() { + @Override public Object[] call(LuanState luan,Object[] args) { LuanTable module = new LuanTable(); try { add( module, "abs", Double.TYPE ); @@ -42,7 +41,7 @@ } catch(NoSuchMethodException e) { throw new RuntimeException(e); } - luan.loaded().put(NAME,module); + return new Object[]{module}; } };