It might sound good to someone new to Clojure, and Lisp as a whole,
but you could ask almost any experienced Lisper, and he'll gladly tell
you that he believes the parentheses only serve to make the code more
readable. It looks weird coming from another language, but once you've
used the parentheses for a while with a good editor like Emacs that
helps you match parentheses, you'll begin to love them.

On Aug 24, 10:23 pm, wangzx <wangzaixi...@gmail.com> wrote:
> (defn hello
>  "Writes hello message to *out*. Calls you by username.
>  Knows if you have been here before."
>         [username]
>         (dosync
>                 (let [past-visitor (@visitors username)]
>                         (if past-visitor
>                                 (str "Welcome back, " username)
>                                 (do
>                                         (alter visitors conj username)
>                                         (str "Hello, " username) ) ) ) ) )
>
> The code is copied from book "Programming Clojure", I think the ) is
> too much for reading. So, can we using the following style:
>
> defn hello [username]
>         dosync
>                 let [past-visitor (@visitors username)]
>                         if past-visitor
>                                 str "welcome back, " username
>                                 do
>                                         alter visitors conj username
>                                         str "Hello, " username
>
> The line indent contains the parenthesis and it looks it is much
> friendly for ready.
>
> I think clojure may mix both the parenthese and python-like indent
> together.
--~--~---------~--~----~------------~-------~--~----~
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