purcell/ac-nrepl — pull request #15 by purcell (2012-10-30 17:06:55+00:00)
Title: Build clojure expressions as elisp sexps, then print them compatibly to strings

Hey @samaaron, I thought you might find this interesting.

Those strings full of clojure inside ac-nrepl bugged me, so I started wondering if we could just send sexps. Turns out that it's possible; you just have to avoid some Clojure reader syntaxes (like "#{}") which are incompatible with Elisp's reader.

This trick makes assembling the sexps much easier, because they can just be `backquote`d together rather than relying on "format".

The downside was that it required some custom printing trickery to work around the fact that Elisp normally `print`s symbols like `clojure.core/map` as `clojure\.core/map`.

I'd be interested to hear what you think.

-Steve