I'm writing a sketch in Clojure/Quil in fun(ctional)-mode.
Sometimes, I want to be able to inspect what the current state holds.
However, when I try to call Quil's state from the REPL I get the following:
(q/state) ==>
NullPointerException clojure.core/deref-future (core.clj:2208)
Not sure if this is relevant, but the same happens with drawing functions from the REPL:
(q/rect 0 0 10 10)
How can I get the current state to inspect it in the REPL?
Not sure which function exactly you are talking about since you do not post code so this is a bit of a blind shot.
You could try to see the state-atom:
(require '[quil.core :as q])
;; both should do the same
@(q/state-atom)
(q/state) ;; is that what you were doing ?
The state function you seem to refer to optionally takes a parameter, for instance, and returns the state-atom when no parameter is passed:
(q/state :image)
In any case, it is generally a good idea to look at the tests of a Clojure library, and the code in this case seems very well documented.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With