vlist


Vocabulary
vlists

Definition
USING: sequences.private vectors ;

IN: vlists

TUPLE: vlist
{ length array-capacity read-only initial: 0 }
{ vector vector read-only initial: V{ } } ;


Methods
USING: prettyprint.custom vlists ;

M: vlist >pprint-sequence ;


USING: accessors kernel vectors vlists ;

M: vlist clone [ length>> ] [ vector>> >vector ] bi vlist boa ;


USING: kernel sequences vlists ;

M: vlist equal? over vlist? [ sequence= ] [ 2drop f ] if ;


USING: accessors sequences vlists ;

M: vlist length length>> ;


USING: kernel sequences vlists ;

M: vlist like drop dup vlist? [ >vlist ] unless ;


USING: accessors sequences.private vlists ;

M: vlist nth-unsafe vector>> nth-unsafe ;


USING: accessors kernel math persistent.sequences sequences
vlists ;

M: vlist ppop
[ empty-vlist-error ]
[ [ length>> 1 - ] [ vector>> ] bi vlist boa ] if-empty ;


USING: prettyprint.custom vlists ;

M: vlist pprint* pprint-object ;


USING: kernel prettyprint.custom vlists ;

M: vlist pprint-delims drop \ VL{ \ } ;


USING: kernel math persistent.sequences sequences vlists
vlists.private ;

M: vlist ppush
>vlist< 2dup length = [ unshare ] unless
[ [ 1 + swap ] dip push ] keep vlist boa ;