diff string.rhope @ 99:e09c2d1d6d5b

Got dataflow graph code working in compiler (nworker_c.rhope)
author Mike Pavone <pavone@retrodev.com>
date Fri, 06 Aug 2010 01:42:37 -0400
parents e73a93fb5de1
children f51c4c17457c
line wrap: on
line diff
--- a/string.rhope	Tue Aug 03 23:51:39 2010 -0400
+++ b/string.rhope	Fri Aug 06 01:42:37 2010 -0400
@@ -647,3 +647,35 @@
 	out <- [compare] = [ends with]
 }
 
+If@String[str:yes,no]
+{
+	yes,no <- If[[str]Length]
+}
+
+If@String Cat[str:yes,no]
+{
+	yes,no <- If[[str]Length]
+}
+
+If@String Slice[str:yes,no]
+{
+	yes,no <- If[[str]Length]
+}
+
+_Split[list,string,delim:out]
+{
+	,,rest <- [string]Partition[delim]
+	{
+		out <- _Split[[list]Append[~], rest, delim]
+	} {} {} {
+		out <- [list]Append[string]
+	}
+}
+
+Split[string,delim:out]
+{
+	If[string]
+	{ out <- _Split[(),string,delim] }
+	{ out <- () }
+}
+