comparison core/src/luan/LuanState.java @ 398:39c4ac11a58a

add LuanState.require()
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 27 Apr 2015 12:44:53 -0600
parents fed1893821bf
children 8f1be9704726
comparison
equal deleted inserted replaced
397:5e0acdeaea93 398:39c4ac11a58a
40 40
41 public final LuanTable registry() { 41 public final LuanTable registry() {
42 return registry; 42 return registry;
43 } 43 }
44 44
45 public final Object require(String modName) throws LuanException {
46 return PackageLuan.require(this,modName);
47 }
48
45 public static LuanState newStandard() { 49 public static LuanState newStandard() {
46 try { 50 try {
47 LuanState luan = LuanCompiler.newLuanState(); 51 LuanState luan = LuanCompiler.newLuanState();
48 PackageLuan.require(luan,"luan:Luan"); 52 luan.require("luan:Luan");
49 PackageLuan.require(luan,"luan:Io"); 53 luan.require("luan:Io");
50 return luan; 54 return luan;
51 } catch(LuanException e) { 55 } catch(LuanException e) {
52 throw new RuntimeException(e); 56 throw new RuntimeException(e);
53 } 57 }
54 } 58 }