More information about state and how to initialize it can be found in the article gen-class - how it works and how to use it
From the article:
:state defines a method that returns the state of an object.:init defines the name of the initializer. This is a function that should return a vector. The first element is again the argument vector to the superclass constructor. In our case, this is just an empty vector. The second element is the state of the object.
Thus, init returns the state of the object and is called when an instance of the object is created. state is a class method, unlike a function that will return the same value that is returned as the second element in the vector returned by init .
The rest of the article shows how to use an atom to be able to change the state of an object, if necessary.
source share