diff string.rhope @ 72:f7bcf3db1342

Add =@String, fix bool bug
author Mike Pavone <pavone@retrodev.com>
date Fri, 18 Jun 2010 17:00:50 -0400
parents c40c3d399133
children a748300a4143
line wrap: on
line diff
--- a/string.rhope	Fri Jun 18 15:07:09 2010 -0400
+++ b/string.rhope	Fri Jun 18 17:00:50 2010 -0400
@@ -153,6 +153,37 @@
 	right <- String Slice[string, slicepoint, [[string]Length >>]-[slicepoint]]
 }
 
+Byte@String[string,index:out,invalid]
+{
+	out,invalid <- [[string]Buffer >>]Index[index]
+}
+
+Length@String[string:out]
+{
+	out <- [string]Length >>
+}
+
+_=String[left,right,index:out]
+{
+	[left]Byte[index]
+	{
+		,out <- If[[~]=[[right]Byte[index]]]
+		{
+			out <- _=String[left,right,[index]+[1]]
+		}
+	}{
+		out <- Yes
+	}
+}
+
+=@String[left,right:out]
+{
+	,out <- If[[[left]Length] = [[right]Length]] 
+	{
+		out <- _=String[left,right,0]
+	}
+}
+
 Blueprint String Slice
 {
 	Source