google / clojure-turtle

A Clojure library that implements the Logo programming language in a Clojure context
Apache License 2.0
425 stars 41 forks source link

event loop discrepancies between CLJ and CLJS #19

Open echeran opened 8 years ago

echeran commented 8 years ago

Based on work for issue #6, we have a wait fn that does what you would expect. But only in the CLJS REPL, and only when you try to mix wait and turtle commands, all of the waiting happens first, and all of the rendering happens at the end. As an example, see the difference in the following at the CLJS REPL:

(do (wait 3000) (forward 30) (wait 3000))
clojure-turtle.core=> (do (wait 3000) (println "hello") (wait 3000))

Perhaps the issue is due to how the rendering event loop in either Processing.js or the CLJS version of Quil is implemented. But for whatever reason, the issue is happening. It would be great to identify the problem and fix it if possible.

echeran commented 8 years ago

Can also try putting all commands (color, wait) into the commands log and see if that would work.