Introduction to Clojure
cio.com.au
Introduction to Clojure
1–10 of 23 posts
Re: Introduction to Clojure
#2Re: Introduction to Clojure
#3Can anyone point me to a paper giving Clojure's formal semantics, if there is one?
Re: Introduction to Clojure
#4Can anyone point me to a paper giving Clojure's formal semantics, if there is one?
I think this is as close as it gets: http://java.ociweb.com/mark/clojure/article.html
Re: Introduction to Clojure
#5Edit: There are other style problems with this article. Worst is probably this one:
Bad: (map (fn [x] (fibonacci x)) [1 2 3 5 6 7 8 9 10])
Good: (map fibonacci (range 1 11))Re: Introduction to Clojure
#6Don't arrange your closing parens the way the author of this article has unless you want to look like a clueless noob. Edit: There are other style problems with this article. Worst is probably this one: Bad: (map (fn [x] (fibonacci x)) [1 2 3 5 6 7 8 9 10]) Good: (map fibonacci (range 1 11))
My 'C' parser keeps telling me 'wrong bracket' though :)
Re: Introduction to Clojure
#7Don't arrange your closing parens the way the author of this article has unless you want to look like a clueless noob. Edit: There are other style problems with this article. Worst is probably this one: Bad: (map (fn [x] (fibonacci x)) [1 2 3 5 6 7 8 9 10]) Good: (map fibonacci (range 1 11))
Interesting, since it is actually in some ways easier to see which closing paren goes with which opening one. My 'C' parser keeps telling me 'wrong bracket' though :)
Re: Introduction to Clojure
#8Earlier quoted context omitted.
Interesting, since it is actually in some ways easier to see which closing paren goes with which opening one. My 'C' parser keeps telling me 'wrong bracket' though :)
Yes, which is why it is a newbie signal. A Lisp programmer with more than about three weeks of experience doesn't look at parentheses or try to match them up with each other. You know the function has ended because the next line of code has no indentation.
Re: Introduction to Clojure
#9Earlier quoted context omitted.
Yes, which is why it is a newbie signal. A Lisp programmer with more than about three weeks of experience doesn't look at parentheses or try to match them up with each other. You know the function has ended because the next line of code has no indentation.
which suggests the use of a 'close all open parens' token to cut down on all the )))))) stuff at the end of a line, which can get really tedious, especially when editing in 'dumb' editors.
The solution is to use the right tool for the job. Emacs has something called paredit-mode that relieves you of having to type the closing parens.
Re: Introduction to Clojure
#10Earlier quoted context omitted.
which suggests the use of a 'close all open parens' token to cut down on all the )))))) stuff at the end of a line, which can get really tedious, especially when editing in 'dumb' editors.
That's not much help when you want to close all but one or two. The solution is to use the right tool for the job. Emacs has something called paredit-mode that relieves you of having to type the closing parens.