Create a ring buffer

ring

[list (array)]

Create a new ring buffer from args. Indexes wrap around positively and negatively

Introduced in v2.2

Example 0 

(ring 1, 2, 3)[0]



#=> 1



Example 1 

(ring 1, 2, 3)[1]



#=> 2



Example 2 

(ring 1, 2, 3)[3]



#=> 1



Example 3 

(ring 1, 2, 3)[-1]



#=> 3