Hello, someone else here had to have an error like mine before. I'm a beginner so I mostly don't know what I'm doing. Could someone help me understand what I did wrong? This is some code from tutorial: https://github.com/quil/quil/wiki/Dynamic-Workflow-(for-REPL) And refresh function idea came from this article: https://tylerxhobbs.com/essays/2015/using-quil-for-artwork
(ns quil-workflow.core
(:require [quil.core :as q])
(:require [quil-workflow.dynamic :as dynamic]))
(defn -main [& args])
(q/defsketch example
:title "Oh so many grey circles"
:setup dynamic/setup
:draw dynamic/draw
:size [500 500])
(defn refresh []
(use :reload 'sketch.dynamic)
(q/.loop example))
user=> (refresh)
Syntax error compiling at (C:\Users\bichasnogg\AppData\Local\Temp\form-init4535082686008255127.clj:1:1).
Unable to resolve symbol: refresh in this context
Any help is appreciated!I'm not affiliated with the Quil team -- but it looks like you're executing code from the wrong namespace.
user=> in your REPL means you're in the user namespace. The code you've written is the quil-workflow.core namespace.
Try loading and switching to quil-workflow.core , something like:
user=> (require 'quil-workflow.core)
user=> (in-ns 'quil-workflow.core)
Now user=> should disappear:
quil-workflow.core=> (refresh)
Does that help?I'm seeing this line in the tutorial you linked to:
(use 'quil-workflow.core)
Are you sure you ran that line?Thank you! These commands fixed my problem and I can now run (refresh) without an error - aside that my function doesn't work as intended. I also found that I wrote in refresh function sketch.dynamic instead of quil-workflow.dynamic.
You might consider dropping the main function and using the standard Clojure editor-connected REPL to develop your sketch. See:
https://lambdaisland.com/guides/clojure-repls