|
The thing that helped me most when I started learning clojure is to mentally move the parenthesis over to the other side, so (println (max 34 64 15))
becomes println(max(34,64,15));
and vice-versa.Another thing that helped is realizing that almost all things that require special syntax in other languages look like function calls in clojure. So, for example, to create a new function, you call the defn "function" and pass it parameters for the name of your new function, the expected arguments, and the body of the function. The last thing is remembering that in clojure, the last statement in the body of the function is automatically the return value of the function, so I just imagined that the last statement had a "return" call in front of it. With these 3 rules I could mentally translate 95% of clojure* to c-style code and back. *The other 5% is mostly about macros, which are what give clojure (and other lisps) the power to add new features to the language via libraries, among other cool things. They they're powerful and used sparingly though, so you won't bump into them too much, and when you do, most will be documented as to how to use them properly. |
I would say that most syntax in other languages is there precisely so that not everything looks like a function call.