Create a ring buffer

ring  list (array)

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

Introduced in v2.2

Examples

# Example 1

(ring 1, 2, 3)[0]



#=> 1



# Example 2

(ring 1, 2, 3)[1]



#=> 2



# Example 3

(ring 1, 2, 3)[3]



#=> 1



# Example 4

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



#=> 3