Mercurial > repos > rhope
diff list.rhope @ 96:5a08705f7610
Semi-broken cleanup of Array implementation
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 02 Aug 2010 05:12:19 -0400 |
parents | e73a93fb5de1 |
children | fa437d23bb24 |
line wrap: on
line diff
--- a/list.rhope Mon Aug 02 01:55:56 2010 -0400 +++ b/list.rhope Mon Aug 02 05:12:19 2010 -0400 @@ -13,14 +13,14 @@ { If[[index] < [0]] { - rev index <- [[[list]Buffer >>]Length >>]+[index] + rev index <- [[[list]Buffer >>]Length]+[index] invalid index <- If[[rev index] < [0]] {} { out,invalid index <- [list]Set[rev index, value] } }{ - len <- [[list]Buffer >>]Length >> + len <- [[list]Buffer >>]Length If[[index] > [len]] { makeleft <- Yes @@ -48,7 +48,7 @@ _Right Set@List Leaf[list,index,val:out,didn't set] { - len <- [[list]Buffer >>]Length >> + len <- [[list]Buffer >>]Length do it <- If[[index] < [len]] {} { ,didn't set <- If[[index]=[len]] @@ -64,12 +64,12 @@ Length@List Leaf[list:out] { - out <- [[list]Buffer >>]Length >> + out <- [[list]Buffer >>]Length } Last@List Leaf[list:out,none] { - len <- [[list]Buffer >>]Length >> + len <- [[list]Buffer >>]Length ,none <-If[len] { out <- [len]-[1] @@ -158,7 +158,7 @@ If[[index]<[[list]Right Offset >>]] { off index <- [index]-[[list]Offset >>] - bsize <- [[list]Buffer >>]Length >> + bsize <- [[list]Buffer >>]Length If[[off index]>[bsize]] { If[[[list]Right >>]Length] @@ -232,7 +232,7 @@ { [[list]Right >>]Last { out <- [~]+[[list]Right Offset >>] } - { out <- [[[[list]Buffer >>]Length >>]-[1]]+[[list]Offset >>] } + { out <- [[[[list]Buffer >>]Length]-[1]]+[[list]Offset >>] } } Append@List[list,val:out] @@ -263,7 +263,7 @@ If[[index] < [[list]Right Offset >>]] { pos next <- [index]+[1] - If[[pos next] < [[[[list]Buffer >>]Length >>]+[[list]Offset >>]]] + If[[pos next] < [[[[list]Buffer >>]Length]+[[list]Offset >>]]] { next <- Val[pos next] }{