diff --git a/std.isbpl b/std.isbpl index 7cb363a..885c8c8 100644 --- a/std.isbpl +++ b/std.isbpl @@ -280,9 +280,10 @@ func acopy { def arr2 =arr2 def arr1 =arr1 - def i 1 neg =i - while { ( i ++ =i ) ( i len lt ) } { + def i 0 =i + while { i len lt } { arr2 ( i idx2 + ) ( arr1 ( i idx1 + ) aget ) aput + i 1 + =i } arr2 diff --git a/stream.isbpl b/stream.isbpl index 14094c3..093eb6c 100644 --- a/stream.isbpl +++ b/stream.isbpl @@ -23,18 +23,18 @@ func stream.readline { def id =id def byte 0 =byte def array 0 anew =array - def tmparray 0 anew =tmparray def i 1 neg =i - id STREAM.read stream =byte - byte -1 eq if { - -1 - 2 stop - } - while { ( i 1 + =i ) ( byte 10 eq not ) } { - array ( ( array alen 1 + anew ) dup =tmparray ) 0 0 ( array alen ) acopy =array - array dup alen 1 - byte _char aput - id STREAM.read stream =byte - } + [ + id STREAM.read stream dup =byte _char + byte -1 eq if { + ] pop + -1 + 2 stop + } + while { ( i 1 + =i ) ( byte 10 eq not ) } { + id STREAM.read stream dup =byte _char + } + ] =array array alen 0 eq if { array _string 2 stop