This answer was for LightTable 0.2.0. I have not yet tried the new 0.3.0.
It makes perfect sense to try and pick LightTable and Quil. I think the pain is mostly due to a chicken and egg problem.
- LightTable assumes some clojure knowledge (at least as regards project management) and doesn't provide a "standard" repl, but rather is a test-bed for an even more interactive style of working.
- Quil assumes comfort in a standard clojure repl environment and is wrapping a lot of complexity of an underlying java project (Processing).
- Also the whole purpose of Quil is to generate "side-effects" (whole other graphical displays) and LightTable is trying to help you work with functions and their return values, not the side-effects of functions.
If you are connecting to quil as a project, opening example2.clj and executing it (Ctrl Shift Enter) and getting a light blue "nil" - Congratulations you have a working system!
(At least I can duplicate the exact same behavior and the example seems to work).
The first time you do this it may take a while for LightTable to download all of Quil's dependencies (maybe why LightTable appeared to hang - or maybe Light Table and Quil have an interaction bug I have yet to trigger.)
That "nil" is the return value resulting from Light Table executing the file (in the context of the running project) (see footnote). Somewhere (perhaps hidden behind a full screen Light Table) a new window should be created with the example running.
The "java.lang.Math" value of executing automata.clj is also consistent with what I see.
Here the trick is to generate a call to defsketch
which example2.clj did inline but automata.clj does not.
You can create the sketch by calling the function run-rule
:
After executing the file automata.clj (to get all the function definitions loaded) add the following line to the end of the file in the editor:
(run-rule 101 {:width 100 :height 100 :scale 4})
Put the cursor after the closing paren and execute the single form with Ctrl-Enter. Again a new window (possibly hidden behind some other window - try task switching with Alt-Tab) should open running the automata demo.
With Light Table connected to the quil project and automata.clj already evaluated you can also get the same effect by opening an "instarepl" and typing:
(clj-automata.core/run-rule 101
{:width 100 :height 100
:scale 4})
Try editing the values and seeing what happens. (Again the whole nature of Quil being side-effecting makes this not quite so elegant in LightTable but it seems to work.)
Footnote:
I am not very familiar with LightTable. I would have expected the light blue to be the result of evaluating the last form in the file but this seems to not to be the case. Using Cntl-Enter on the last line reveals "#'example2/example2" not "nil".
I am also not very familiar with Quil and defsketch
is macro not a regular function so maybe that is interacting in an odd way with LightTable.