[Swift-commit] r4756 - in trunk/src/org/griphyn/vdl/karajan/lib: . swiftscript

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Sun Jul 3 19:21:48 CDT 2011


Author: hategan
Date: 2011-07-03 19:21:48 -0500 (Sun, 03 Jul 2011)
New Revision: 4756

Modified:
   trunk/src/org/griphyn/vdl/karajan/lib/SwiftArg.java
   trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
Log:
fixed dirname()

Modified: trunk/src/org/griphyn/vdl/karajan/lib/SwiftArg.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/SwiftArg.java	2011-07-03 21:51:26 UTC (rev 4755)
+++ trunk/src/org/griphyn/vdl/karajan/lib/SwiftArg.java	2011-07-04 00:21:48 UTC (rev 4756)
@@ -53,8 +53,12 @@
 
 	public Object getValue(VariableStack stack) throws ExecutionException {
 		Object v = super.getValue(stack);
-		if(v == null) return v;
-			else return unwrap(stack, super.getValue(stack));
+		if (v == null) {
+		    return v;
+		}
+		else {
+		    return unwrap(stack, super.getValue(stack));
+		}
 	}
 
 	public double getDoubleValue(VariableStack stack) throws ExecutionException {

Modified: trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java	2011-07-03 21:51:26 UTC (rev 4755)
+++ trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java	2011-07-04 00:21:48 UTC (rev 4756)
@@ -1,6 +1,7 @@
 package org.griphyn.vdl.karajan.lib.swiftscript;
 
 import java.io.IOException;
+import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -378,11 +379,8 @@
 	 */
 	public DSHandle swiftscript_length(VariableStack stack)
 	throws ExecutionException {
-	    AbstractDataNode n = (AbstractDataNode) PA_ARRAY.getValue(stack);
-	    n.waitFor();
-	    ArrayDataNode adn = (ArrayDataNode) n;
-
-	    return RootDataNode.newNode(Types.INT, Integer.valueOf(adn.size()));
+	    Map<?, ?> n = (Map<?, ?>) PA_ARRAY.getValue(stack);
+	    return RootDataNode.newNode(Types.INT, Integer.valueOf(n.size()));
 	}
 
 	public DSHandle swiftscript_existsfile(VariableStack stack)




More information about the Swift-commit mailing list