Circular sequences


The circular vocabulary implements the Sequence protocol to allow an arbitrary start index and wrap-around indexing.

Creating a new circular object:
<circular> ( seq -- circular )

<circular-string> ( n -- circular )

<growing-circular> ( capacity -- growing-circular )


Changing the start index:
change-circular-start ( n circular -- )

rotate-circular ( circular -- )


Pushing new elements:
circular-push ( elt circular -- )

growing-circular-push ( elt circular -- )


Iterating over a circular until a stop condition:
circular-while ( ... circular quot: ( ... obj -- ... ? ) -- ... )

circular-loop ( ... circular quot: ( ... obj -- ... ? ) -- ... )