Hi, Am 03.12.2008 um 22:06 schrieb levand:
I am coming to Clojure from the Java side, and am completely ignorant about lisp indentation & newline conventions.
Good. Then you aren't spoiled, yet. ;) My advice: get a reasonable editor like emacs or vim and the corresponding clojure modes. They will help you with automatic indentation. Just go with that and you won't have problems.
Which leads to the other immortal question - tab characters, or [n] consecutive spaces? I'm fairly ambivalent myself and can go either way, but is there a clear preferred way in the clojure community that I would be better served by adhering to?
Never ever use tabs. Eg. (some-function xxx yyy) is one way to format a multi-line function call. Mixing tabs and spaces in front of the yyy just begs for ugly effects for people with different tab settings. And since the function name in general doesn't align well with tabs you need spaces anyway. So use only spaces.
Does anyone know of a reference for, or would care to enumerate what standard clojure indenting ought to be?
Personally, I like the vim way of indenting. But that's not a reference of course.
I'm particularly interested in this as I've been hacking about with a clojure eclipse plugin for my own use and am considering adding auto- indent features.
In that case, I'd suggest to pick a style you like from an other editor or a particular library (eg. clojure.core itself) and try to implement that. This easily turns into religious flame wars. So my Disclaimer: Nothing of the said (except maybe the tab thing) is any reference and your mileage may vary! Sincerely Meikel
smime.p7s
Description: S/MIME cryptographic signature