diff string.rhope @ 179:64be565a40c6

Implement If method on List, fix Get Char to handle end of file, fix nested list pretty printing
author Mike Pavone <pavone@retrodev.com>
date Sat, 18 Jun 2011 11:11:58 -0700
parents f97a7d499182
children
line wrap: on
line diff
--- a/string.rhope	Wed Jun 15 01:18:28 2011 -0700
+++ b/string.rhope	Sat Jun 18 11:11:58 2011 -0700
@@ -106,11 +106,12 @@
 	{ out <- write[1i32, [Array[]]Append[10u8], 1i64] }
 }
 
-Get Char[:out]
+Get Char[:out,err]
 {
-	read[0, [Array[]]Set[0, 0u8], 1i64]
-	{}
-	{ out <- String[~] }
+	ret,data <- read[0, [Array[]]Set[0, 0u8], 1i64]
+	If[[ret]<[1i64]]
+	{ err <- Val[ret] }
+	{ out <- String[data] }
 }
 
 _String to Int[current,index,array,ten,conv:out]