changeset 123:d7be9b3abf1a

minor - rename LuanFunction.EMPTY to NOTHING git-svn-id: https://luan-java.googlecode.com/svn/trunk@124 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Fri, 06 Jun 2014 01:14:18 +0000
parents d00f41edbbd6
children f537ff5e511d
files src/luan/LuanBit.java src/luan/LuanFunction.java src/luan/LuanJavaFunction.java src/luan/interp/Closure.java src/luan/interp/LuanStateImpl.java src/luan/lib/BasicLib.java src/luan/lib/PackageLib.java
diffstat 7 files changed, 14 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
diff -r d00f41edbbd6 -r d7be9b3abf1a src/luan/LuanBit.java
--- a/src/luan/LuanBit.java	Wed Jun 04 06:15:47 2014 +0000
+++ b/src/luan/LuanBit.java	Fri Jun 06 01:14:18 2014 +0000
@@ -17,7 +17,7 @@
 	}
 
 	public Object call(LuanFunction fn,String fnName) throws LuanException {
-		return call(fn,fnName,LuanFunction.EMPTY);
+		return call(fn,fnName,LuanFunction.NOTHING);
 	}
 
 	public Object call(LuanFunction fn,String fnName,Object[] args) throws LuanException {
diff -r d00f41edbbd6 -r d7be9b3abf1a src/luan/LuanFunction.java
--- a/src/luan/LuanFunction.java	Wed Jun 04 06:15:47 2014 +0000
+++ b/src/luan/LuanFunction.java	Fri Jun 06 01:14:18 2014 +0000
@@ -5,7 +5,7 @@
 
 	public abstract Object call(LuanState luan,Object[] args) throws LuanException;
 
-	public static final Object[] EMPTY = new Object[0];
+	public static final Object[] NOTHING = new Object[0];
 
 	@Override public String toString() {
 		return "function: " + Integer.toHexString(hashCode());
diff -r d00f41edbbd6 -r d7be9b3abf1a src/luan/LuanJavaFunction.java
--- a/src/luan/LuanJavaFunction.java	Wed Jun 04 06:15:47 2014 +0000
+++ b/src/luan/LuanJavaFunction.java	Fri Jun 06 01:14:18 2014 +0000
@@ -159,9 +159,9 @@
 		public Object convert(Object obj);
 	}
 
-	private static final RtnConverter RTN_EMPTY = new RtnConverter() {
+	private static final RtnConverter RTN_NOTHING = new RtnConverter() {
 		@Override public Object[] convert(Object obj) {
-			return EMPTY;
+			return NOTHING;
 		}
 	};
 
@@ -186,7 +186,7 @@
 	private static RtnConverter getRtnConverter(JavaMethod m) {
 		Class<?> rtnType = m.getReturnType();
 		if( rtnType == Void.TYPE )
-			return RTN_EMPTY;
+			return RTN_NOTHING;
 		if( rtnType.isArray() && isNumber(rtnType.getComponentType()) )
 			return RTN_NUMBER_ARRAY;
 		return RTN_SAME;
diff -r d00f41edbbd6 -r d7be9b3abf1a src/luan/interp/Closure.java
--- a/src/luan/interp/Closure.java	Wed Jun 04 06:15:47 2014 +0000
+++ b/src/luan/interp/Closure.java	Fri Jun 06 01:14:18 2014 +0000
@@ -53,7 +53,7 @@
 						varArgs[i] = args[fnDef.numArgs+i];
 					}
 				} else {
-					varArgs = LuanFunction.EMPTY;
+					varArgs = LuanFunction.NOTHING;
 				}
 			}
 			Object[] stack = luan.newFrame(closure,fnDef.stackSize,varArgs);
diff -r d00f41edbbd6 -r d7be9b3abf1a src/luan/interp/LuanStateImpl.java
--- a/src/luan/interp/LuanStateImpl.java	Wed Jun 04 06:15:47 2014 +0000
+++ b/src/luan/interp/LuanStateImpl.java	Fri Jun 06 01:14:18 2014 +0000
@@ -55,7 +55,7 @@
 	}
 
 	private Frame frame = null;
-	Object returnValues = LuanFunction.EMPTY;
+	Object returnValues = LuanFunction.NOTHING;
 	Closure tailFn;
 	Map<UpValue.EnvGetter,UpValue> envs = new HashMap<UpValue.EnvGetter,UpValue>();
 
@@ -87,7 +87,7 @@
 	}
 
 	void popFrame() {
-		returnValues = LuanFunction.EMPTY;
+		returnValues = LuanFunction.NOTHING;
 		tailFn = null;
 		frame = frame.previousFrame;
 	}
diff -r d00f41edbbd6 -r d7be9b3abf1a src/luan/lib/BasicLib.java
--- a/src/luan/lib/BasicLib.java	Wed Jun 04 06:15:47 2014 +0000
+++ b/src/luan/lib/BasicLib.java	Fri Jun 06 01:14:18 2014 +0000
@@ -120,7 +120,7 @@
 		return new LuanFunction() {
 			@Override public Object[] call(LuanState luan,Object[] args) {
 				if( !iter.hasNext() )
-					return LuanFunction.EMPTY;
+					return LuanFunction.NOTHING;
 				Map.Entry<Object,Object> entry = iter.next();
 				return new Object[]{entry.getKey(),entry.getValue()};
 			}
@@ -229,7 +229,7 @@
 
 			@Override public Object call(LuanState luan,Object[] args) {
 				if( step > 0.0 && v > to || step < 0.0 && v < to )
-					return LuanFunction.EMPTY;
+					return LuanFunction.NOTHING;
 				double rtn = v;
 				v += step;
 				return rtn;
diff -r d00f41edbbd6 -r d7be9b3abf1a src/luan/lib/PackageLib.java
--- a/src/luan/lib/PackageLib.java	Wed Jun 04 06:15:47 2014 +0000
+++ b/src/luan/lib/PackageLib.java	Fri Jun 06 01:14:18 2014 +0000
@@ -105,9 +105,9 @@
 			String modName = (String)args[0];
 			String path = (String)luan.get("Package.path");
 			if( path==null )
-				return LuanFunction.EMPTY;
+				return LuanFunction.NOTHING;
 			String file = search_path(modName,path);
-			return file==null ? LuanFunction.EMPTY : new Object[]{fileLoader,file};
+			return file==null ? LuanFunction.NOTHING : new Object[]{fileLoader,file};
 		}
 	};
 
@@ -140,7 +140,7 @@
 			String modName = (String)args[0];
 			String path = (String)luan.get("Package.jpath");
 			if( path==null )
-				return LuanFunction.EMPTY;
+				return LuanFunction.NOTHING;
 			for( String s : path.split(";") ) {
 				String file = s.replaceAll("\\?",modName);
 				URL url = ClassLoader.getSystemResource(file);
@@ -148,7 +148,7 @@
 					return new Object[]{javaFileLoader,url.toString()};
 				}
 			}
-			return LuanFunction.EMPTY;
+			return LuanFunction.NOTHING;
 		}
 	};