diff extendlib.rhope @ 30:914ad38f9b59

Compiler now works for some simple programs
author Mike Pavone <pavone@retrodev.com>
date Mon, 28 Sep 2009 19:42:33 -0400
parents 8b2b3f4a2a58
children 6202b866d72c
line wrap: on
line diff
--- a/extendlib.rhope	Sat Jun 27 01:50:33 2009 -0400
+++ b/extendlib.rhope	Mon Sep 28 19:42:33 2009 -0400
@@ -653,5 +653,64 @@
 	}
 }
 
+_Collection =[col1,key1,col2,key2:out]
+{
+	,out <- If[[key1]=[key2]]
+	{
+		,out <- If[[[col1]Index[key1]] = [[col2]Index[key2]]]
+		{
+			nkey1 <- [col1]Next[key1]
+			{
+				[col2]Next[key2]
+				{
+					out <- _Collection =[col1,nkey1,col2,~]
+				}{
+					out <- No
+				}
+			}{
+				[col2]Next[key2]
+				{
+					out <- No
+				}{
+					out <- Yes
+				}
+			}
+		}
+	}
+}
 
+Collection =[col1,col2:out]
+{
+	first1 <- [col1]First
+	{
+		[col2]First
+		{
+			out <- _Collection =[col1, first1, col2, ~]
+		}{
+			out <- No
+		}
+	}{
+		[col2]First
+		{
+			out <- No
+		}{
+			out <- Yes
+		}
+	}
+}
 
+=@List[list1,list2:out]
+{
+	,out <- If[[[list1]Length >>] = [[list2]Length >>]]
+	{
+		out <- Collection =[list1,list2]
+	}
+}
+
+=@Dictionary[list1,list2:out]
+{
+	,out <- If[[[list1]Length >>] = [[list2]Length >>]]
+	{
+		out <- Collection =[list1,list2]
+	}
+}