Idiomatic Clojure with LightTable
LightTable, the famous innovative IDE (slash reactive work surface, as described by the author) recently got some pretty amazing additions: user defined plugins and user defined custom expressions.
Custom expressions allow users to define functions that get any block of text and replace with the result, stream information back to LightTable, or display the result inline:
The clojure project Kibit immediately came to mind when I saw the new addition. Kibit is a static code analyzer for Clojure that allows you to find a more idiomatic way of writing a given block of text.
So I wrote this short LightTable integration for it. With it, LightTable can replace any s-expression with its more idiomatic version. For instance, this code:
becomes:
To see how Kibit did, here is the before and after shots of the expression broken down in its components:
After:
In order to use Kibit with LightTable, you just need to:
1. add lein-kibit it to your project.clj:
2. add the integration function to your usermap:
The sample project can be found on GitHub.
Comments Off on Idiomatic Clojure with LightTable