# HG changeset patch # User Mike Pavone # Date 1308420718 25200 # Node ID 64be565a40c69a6689db582b4883077ae174f071 # Parent ed322ae647383f6144ba9ae2ac94b03efd19fdff Implement If method on List, fix Get Char to handle end of file, fix nested list pretty printing diff -r ed322ae64738 -r 64be565a40c6 list.rhope --- a/list.rhope Wed Jun 15 01:18:28 2011 -0700 +++ b/list.rhope Sat Jun 18 11:11:58 2011 -0700 @@ -354,7 +354,7 @@ _String Seq[text,val,key:out] { - out <- [text]Append[ [[["\n\t"]Append[String[key]]]Append[":\t"]]Append[ [[String[val]]Split["\n"]]Join["\t\n"] ] ] + out <- [text]Append[ [[["\n\t"]Append[String[key]]]Append[":\t"]]Append[ [[String[val]]Split["\n"]]Join["\n\t"] ] ] } String@List Leaf[list:out] @@ -378,6 +378,15 @@ { out <- _Print Seq[list, [list]First] } } +If@List Leaf[list:yep,nope] +{ + yep,nope <- If[[[list]Buffer >>]Length] +} + +If@List[list:yep,nope] +{ + yep,nope <- If[[list]Length >>] +} Peek@List[list:out,empty] { diff -r ed322ae64738 -r 64be565a40c6 string.rhope --- 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]