On May 20, 2011, at 3:30 PM, David Nolen wrote:
> Ah I thought you were talking about proper automatic indentation as you enter 
> in code not selective *re-indentation*. As far as I can tell in the existing 
> Clojure tools there are only varying degrees of interpretation as to what 
> constitutes proper Lisp formatting.
> 
> But I've found this to be the case regardless of what combination of 
> programming language + editing tool I use. 
> 
> David

Ah -- okay, so in your terminology I guess I mean that it's Clojure-aware 
"re-indenting" that I think is a base-line requirement for a Clojure editor in 
the "sweet spot" of functionality that's necessary for non-trivial work but 
nonetheless simple enough, I hope, to be a target for a straightforward and 
relatively foolproof download/install process. Leiningen plus a 
simple-to-download editor with Clojure-aware RE-indenting and bracket matching 
would, I think, land in this sweet spot, providing a REPL and an editor and 
even easy project management via lein. It wouldn't provide other nice IDE 
features, but I think it wold be very helpful to have something like this.

The reason that I think that this re-indenting feature is so important is that 
I've found that it's often the most effective way to spot simple coding errors: 
ask the editor to indent things appropriately and if something looks odd it's 
because the syntax isn't what you thought it was. The helps me quite a bit even 
after decades of Lisp programming, and I've found it to be really valuable in a 
teaching context. FWIW reasonable versions of this feature are available for 
Clojure in (at least) emacs, Eclipse/Counterclockwise, MCLIDE, 
NetBeans/Enclojure, TextMate, ..., but in my experience all of these are 
somewhat outside of the sweet spot for other reasons. And some version of this 
feature is available in most other Lisp/Scheme environments (all that I've 
worked in, I think -- I've come to think of it as completely standard and 
necessary for Lisp coding). The implementations that I listed don't all agree 
on what the "correct" indentation is, but they all have some version of this 
feature.

BTW from what I can tell JEdit doesn't even do reasonable automatic indentation 
as you enter code in the first place. If I type "(defn foo" and hit return the 
cursor ends up under the second "o" in "foo", and that seems pretty weird. If I 
type "(conj '(a b c)" and hit return it lines up under the "a" which is even 
odder -- some would say it should end up under the single quote (that'd be my 
vote in this situation), while some would put it under the "o" or the "n", but 
I don't see any rationale for it being under the "a".

BTW also I mentioned MCLIDE above and I have to say that that's looking really 
wonderful to me these days, providing the stuff I mentioned above in a package 
with trivial download/setup and also many nice IDE features (including my 
all-time favorite feature, arglist-on-space). Clojure support is now fully 
baked in. I *think* (but haven't yet had the time to verify) that it should be 
pretty easy to integrate MCLIDE work with leiningen based projects, just by 
using lein from the command line and using "lein classpath" to get the info to 
paste into MCLIDE's launch scripts so that code run within MCLIDE finds 
everything. (Actually I think this might take a little tweaking but that it'll 
be relatively easy to automate...). The one big downside is that this only runs 
in Mac OS X.

 -Lee

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to