Mercurial Hosting > luan
comparison core/src/luan/modules/ThreadLuan.java @ 221:ec016471c6eb
make LuanTable an interface
git-svn-id: https://luan-java.googlecode.com/svn/trunk@222 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Thu, 17 Jul 2014 07:49:26 +0000 |
parents | 3dcb0f9bee82 |
children | a6bf8ff720f8 |
comparison
equal
deleted
inserted
replaced
220:61afe2a1ce96 | 221:ec016471c6eb |
---|---|
1 package luan.modules; | 1 package luan.modules; |
2 | 2 |
3 import java.util.concurrent.Executor; | 3 import java.util.concurrent.Executor; |
4 import java.util.concurrent.Executors; | 4 import java.util.concurrent.Executors; |
5 import luan.Luan; | |
5 import luan.LuanState; | 6 import luan.LuanState; |
6 import luan.LuanFunction; | 7 import luan.LuanFunction; |
7 import luan.LuanTable; | 8 import luan.LuanTable; |
8 import luan.LuanJavaFunction; | 9 import luan.LuanJavaFunction; |
9 import luan.LuanException; | 10 import luan.LuanException; |
12 | 13 |
13 public final class ThreadLuan { | 14 public final class ThreadLuan { |
14 | 15 |
15 public static final LuanFunction LOADER = new LuanFunction() { | 16 public static final LuanFunction LOADER = new LuanFunction() { |
16 @Override public Object call(LuanState luan,Object[] args) { | 17 @Override public Object call(LuanState luan,Object[] args) { |
17 LuanTable module = new LuanTable(); | 18 LuanTable module = Luan.newTable(); |
18 try { | 19 try { |
19 add( module, "fork", LuanState.class, LuanFunction.class, new Object[0].getClass() ); | 20 add( module, "fork", LuanState.class, LuanFunction.class, new Object[0].getClass() ); |
20 } catch(NoSuchMethodException e) { | 21 } catch(NoSuchMethodException e) { |
21 throw new RuntimeException(e); | 22 throw new RuntimeException(e); |
22 } | 23 } |