Another data point: the Clojure source code (the part that's actually
written in Clojure) is indented, and it's open source.
Bill Smith
Austin, TX
As someone who came to Clojure from Python (primarily), I can tell you
that as the language gains traction, these kind of "little things" can
be amazingly valuable to people getting started who obsess over small
details. I'm an Emacs weenie of 20 years, so I don't really sweat the
indentation issue, but there's a lot of people who aren't, and for
whom there is no familiarity with Lisp. For example, how Clojure
indents is different than how I used to indent INTERLISP for example.
Something like Python's PEP8 [1] would be very useful. This would also
cover naming conventions (recently discussed in the library author's
thread), and things like that. A lot of the Python tools (like Rope
for refactoring) can also move things around to make it "fit" the
style.
Chris
[1] http://www.python.org/dev/peps/pep-0008/
--
| Chris Petrilli
| petr...@amber.org
1. That indentation is *extremely* important.
2. That it's not straightforward ( relative to C-languages ).
3. You're not expected to easily indent code manually.
After realizing those things, spending a couple of minutes to figure
out auto-indentation was all it took to overcome that hurdle.
-Patrick
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
I think there are also several ways of identing clojure code, depending on what the tools provide out-of-the-box, and of devs personal preferences:
* do you see a reindenter like something that will just correctly change the number of beginning spaces of each line, or also something that could reformat the whole line as well (removing extra spaces, ...)
(map vec
(partition 2
(map foo
(filter bar? baz))))
vs.
(->> baz
(filter bar?)
(map foo)
(partition 2)
(map vec))
The algorithm used is identical, but the structure of the code is
quite different, perhaps being more or less readable. It may be worth
including such details in addition to where one sticks whitespace.
The algorithm used is identical, but the structure of the code is
quite different, perhaps being more or less readable. It may be worth
including such details in addition to where one sticks whitespace.
This is insightful and succinct advise which would be a great FAQ or
pre-amble to a resource on formatting styles/options.