A few questions about "hello world" in clojure
clojure
Solution
`println` is a built-in function in Clojure, and just happens to have the same name as in Java (check out the source). Some Java libraries are imported by default (`java.io` and `java.lang` I think).
The parentheses are syntax for calling a function and come from Lisp. For example, this function call in Java:
addTwoNumbers(4, 5);
would be written as follows in Clojure (and Lisp):
(addTwoNumbers 4 5)
Clojure's community is vibrant and growing. Check out the Google Group
Problem
I have a couple of questions about Hello World in Clojure: ``` (println "Hello, world!") ``` - Since 'println' is used, does this mean some Java libraries are included in the default namespace by default, just as in Grails? - Why are the braces needed around the statement? Judging by other examples (below), braces are commonplace: ``` (let [i (atom 0)] (defn generate-unique-id "Returns a distinct numeric ID for each call." [] (swap! i inc))) ``` - Any evidence so far that Clojure is likely to catch on?