A circular buffer, cyclic buffer or ring buffer is a data structure that uses a single, fixed-size buffer as if it were connected end-to-end. This structure lends itself easily to buffering data streams.
var b = newRingBuffer[int](5)
b.add([1, 2, 3, 4, 5])
b.add(6)
b.add([7, 8])
@b == [4, 5, 6, 7, 8]