Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm interested in writing a simple rest API using compojure as a learning exercise. Can anyone experienced give an outline of what a reasonable workflow would be to do this using light table? I see that light table can "connect" to my project.clj...


1. make a new lein project

2. fill in the dependencies in project.clj

3. open your src/core.clj (or whatever) in LT

4. start coding

LT will automatically launch a client and connect to it. In between lein will have seamlessly fetched the dependencies for you (this happens automatically each time you launch or relaunch a client).

You can do manual (C-Enter) or live (Instarepl) inline evaluation in any of your project file or even connect a new fresh repl to the client to experiment from scratch.


Would you then recommend focusing development around some unit tests and eval-ing them as you do work? (that's what I am trying so far, seems ok)


Precisely. This is at least how I do it.

It is also pretty nice to have an Instarepl where you can see live changes, either in your source files or in a separate repl. Don't forget that if your paths and namespaces match you can require your namespaces at will.


I'm normally not a screencasts kind of guy, but is there a good one for using the REPL to assemble, oh, say a web app in Compojure? I started doing a Clojure/Compojure tutorial the other day and I thought I was doing way too much restarting to get changes to take effect (using emacs/nrepl).


Are you using the wrap-reload Ring middleware? That seemed to make most restarts not necessary for me.


Nope. Thanks for the pointer.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: