Yes, Jarkko, that Scheme guide is very useful.
Would it be worthwhile to refine it with some clojure-specific things
and promote it somewhere where people will see it (to the Clojure web
site)?

On Jul 19, 3:52 pm, Jarkko Oranen <chous...@gmail.com> wrote:
> Hi.
>
> I'm not aware of any comprehensive style guide for Clojure. However,
> there is a scheme style guide athttp://mumble.net/~campbell/scheme/style.txt
> which contains plenty of good advice that applies to Clojure as well.
>
> In addition to the above advice, I have a personal recommendation
> regarding Clojure java interop: Avoid using the . (dot) form directly
> -- use the sugared alternatives: (.field foo) for instance fields/
> methods and Classname/staticField for static fields, eg. (println Math/
> PI) or (System/exit 0).
>
> My reasoning for this is that in a call form, the operator position is
> more important than the rest of the list, and just having "." there
> tells you nothing but that the code is going to access Java in some
> way. If you use the specialised syntax, any reader of the code will
> also immediately know whether you're accessing static or instance
> fields.
>
> Moreover, learn the -> macro. It can really make a big difference when
> chaining lots of method calls. :) (There's also .., but I prefer ->
> because it allows chaining both clojure functions and java methods)
>
> --
> Jarkko

--~--~---------~--~----~------------~-------~--~----~
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