Mercurial Hosting > luan
comparison core/src/luan/LuanState.java @ 400:8f1be9704726
change LuanState.newStandard() to newInstance() which doesn't preload anything
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 28 Apr 2015 13:12:17 -0600 |
parents | 39c4ac11a58a |
children | d55e873e1f0d |
comparison
equal
deleted
inserted
replaced
399:199eb7f1b828 | 400:8f1be9704726 |
---|---|
44 | 44 |
45 public final Object require(String modName) throws LuanException { | 45 public final Object require(String modName) throws LuanException { |
46 return PackageLuan.require(this,modName); | 46 return PackageLuan.require(this,modName); |
47 } | 47 } |
48 | 48 |
49 public static LuanState newStandard() { | 49 public static LuanState newInstance() { |
50 try { | 50 return LuanCompiler.newLuanState(); |
51 LuanState luan = LuanCompiler.newLuanState(); | |
52 luan.require("luan:Luan"); | |
53 luan.require("luan:Io"); | |
54 return luan; | |
55 } catch(LuanException e) { | |
56 throw new RuntimeException(e); | |
57 } | |
58 } | 51 } |
59 | 52 |
60 public final Object eval(String cmd) throws LuanException { | 53 public final Object eval(String cmd) throws LuanException { |
61 return eval(cmd,new LuanTableImpl()); | 54 return eval(cmd,new LuanTableImpl()); |
62 } | 55 } |