changeset 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 199eb7f1b828
children 322c03d85ada
files core/src/luan/Luan.java core/src/luan/LuanState.java web/src/luan/modules/web/LuanServlet.java
diffstat 3 files changed, 4 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
diff -r 199eb7f1b828 -r 8f1be9704726 core/src/luan/Luan.java
--- a/core/src/luan/Luan.java	Mon Apr 27 16:59:35 2015 -0600
+++ b/core/src/luan/Luan.java	Tue Apr 28 13:12:17 2015 -0600
@@ -7,7 +7,7 @@
 public final class Luan {
 
 	public static void main(String[] args) {
-		LuanState luan = LuanState.newStandard();
+		LuanState luan = LuanState.newInstance();
 		try {
 			LuanFunction standalone = (LuanFunction)BasicLuan.load_file(luan,"classpath:luan/cmd_line.luan",null);
 			luan.call(standalone,args);
diff -r 199eb7f1b828 -r 8f1be9704726 core/src/luan/LuanState.java
--- a/core/src/luan/LuanState.java	Mon Apr 27 16:59:35 2015 -0600
+++ b/core/src/luan/LuanState.java	Tue Apr 28 13:12:17 2015 -0600
@@ -46,15 +46,8 @@
 		return PackageLuan.require(this,modName);
 	}
 
-	public static LuanState newStandard() {
-		try {
-			LuanState luan = LuanCompiler.newLuanState();
-			luan.require("luan:Luan");
-			luan.require("luan:Io");
-			return luan;
-		} catch(LuanException e) {
-			throw new RuntimeException(e);
-		}
+	public static LuanState newInstance() {
+		return LuanCompiler.newLuanState();
 	}
 
 	public final Object eval(String cmd) throws LuanException {
diff -r 199eb7f1b828 -r 8f1be9704726 web/src/luan/modules/web/LuanServlet.java
--- a/web/src/luan/modules/web/LuanServlet.java	Mon Apr 27 16:59:35 2015 -0600
+++ b/web/src/luan/modules/web/LuanServlet.java	Tue Apr 28 13:12:17 2015 -0600
@@ -19,7 +19,7 @@
 	}
 
 	public LuanServlet(String uriPrefix) {
-		this(uriPrefix,LuanState.newStandard());
+		this(uriPrefix,LuanState.newInstance());
 	}
 
 	protected void service(HttpServletRequest request,HttpServletResponse response)