For a much more useful and, I think, nice way to do something like this I have a new project: https://github.com/boxed/indent-clj
An implementation of a subset of the Readable Lisp Project ( http://readable.sourceforge.net/ ). Currently only tested with some Clojure code and only supports the indent-instead-of-parenthesis part of the Readable Lisp spec. Even those parts are probably rather buggy :P
Example:
ns timelike.node
:refer-clojure
:exclude
[time future]
:import
java.util.concurrent
ConcurrentSkipListSet
CountDownLatch
LinkedBlockingQueue
LinkedTransferQueue
TimeUnit
:use
timelike.scheduler
clojure.math.numeric-tower
[incanter.distributions :only [draw exponential-distribution]]is turned into this (although not pretty-printed like this):
(ns timelike.node
(:refer-clojure
:exclude
[time future])
(:import
(java.util.concurrent
ConcurrentSkipListSet
CountDownLatch
LinkedBlockingQueue
LinkedTransferQueue
TimeUnit))
(:use
timelike.scheduler
clojure.math.numeric-tower
[incanter.distributions :only [draw exponential-distribution]]))untab test.clj-readable
will output standard Clojure source code for the file test.clj-readable
I wrote this because I wanted to play around with the concept of Readable Lisp but getting that project to build on my machine took me a long time and at the end I couldn't even get it to work. Then I found the Parsley library which seemed to make it a bit easier to write parsers so I thought I'd give it a shot since I've never played with parser libraries before :P