(ppush-new-tail) do-expansion
swap 0 1node >>tail ;
-M: persistent-vector ppush ( val pvec -- pvec' )
+M: persistent-vector ppush
clone
dup tail>> full?
[ ppush-new-tail ] [ ppush-tail ] if
[ (new-nth) ] node-change-nth
] if ;
-M: persistent-vector new-nth ( obj i pvec -- pvec' )
+M: persistent-vector new-nth
2dup count>> = [ nip ppush ] [
clone
2dup tail-offset >= [
PRIVATE>
-M: persistent-vector ppop ( pvec -- pvec' )
+M: persistent-vector ppop
dup count>> {
{ 0 [ empty-error ] }
{ 1 [ drop T{ persistent-vector } ] }