Mercurial > repos > rhope
comparison 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 |
comparison
equal
deleted
inserted
replaced
178:ed322ae64738 | 179:64be565a40c6 |
---|---|
104 //TODO: Sanitize string (remove terminal escapes and replace invalid UTF) | 104 //TODO: Sanitize string (remove terminal escapes and replace invalid UTF) |
105 write[1i32, [string]Buffer >>, Int64[[[string]Buffer >>]Length >>]] | 105 write[1i32, [string]Buffer >>, Int64[[[string]Buffer >>]Length >>]] |
106 { out <- write[1i32, [Array[]]Append[10u8], 1i64] } | 106 { out <- write[1i32, [Array[]]Append[10u8], 1i64] } |
107 } | 107 } |
108 | 108 |
109 Get Char[:out] | 109 Get Char[:out,err] |
110 { | 110 { |
111 read[0, [Array[]]Set[0, 0u8], 1i64] | 111 ret,data <- read[0, [Array[]]Set[0, 0u8], 1i64] |
112 {} | 112 If[[ret]<[1i64]] |
113 { out <- String[~] } | 113 { err <- Val[ret] } |
114 { out <- String[data] } | |
114 } | 115 } |
115 | 116 |
116 _String to Int[current,index,array,ten,conv:out] | 117 _String to Int[current,index,array,ten,conv:out] |
117 { | 118 { |
118 char <- [array]Index[index] | 119 char <- [array]Index[index] |