changeset 398:39c4ac11a58a

add LuanState.require()
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 27 Apr 2015 12:44:53 -0600
parents 5e0acdeaea93
children 199eb7f1b828
files core/src/luan/LuanState.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
diff -r 5e0acdeaea93 -r 39c4ac11a58a core/src/luan/LuanState.java
--- a/core/src/luan/LuanState.java	Mon Apr 27 12:25:30 2015 -0600
+++ b/core/src/luan/LuanState.java	Mon Apr 27 12:44:53 2015 -0600
@@ -42,11 +42,15 @@
 		return registry;
 	}
 
+	public final Object require(String modName) throws LuanException {
+		return PackageLuan.require(this,modName);
+	}
+
 	public static LuanState newStandard() {
 		try {
 			LuanState luan = LuanCompiler.newLuanState();
-			PackageLuan.require(luan,"luan:Luan");
-			PackageLuan.require(luan,"luan:Io");
+			luan.require("luan:Luan");
+			luan.require("luan:Io");
 			return luan;
 		} catch(LuanException e) {
 			throw new RuntimeException(e);