Is there a function in clojure that checks if the data contains some lazy part?
Background:
I am creating a small server in clojure. Each connection has a state, input stream and output stream
The server reads the byte from the input stream and, based on the value, calls one of several functions (with state and input and output stream as parameters). Functions may decide to read more from the input stream, write a response to the output stream, and return a state. This part of the cycle.
This will all work fine if there are no lazy parts in the state. If there is some lazy part in the state that can, when it is evaluated (later, during another function), begin to read from the input stream and write to the output stream.
So basically, I want to add a post-condition to all these functions, stating that no part of the return state can be lazy. Is there a function that checks lazy sequences. I think it would be easy to check whether the state itself is a lazy sequence, but I want, for example, to check whether the state has a vector containing a hash map, one of which is lazy.
source share