by ericlavigne · 17y ago · 0 comments
http://clojure.org/multimethods
The integration with Java is almost seamless, so of course you can also use Java-style OOP if you're feeling masochistic :-P
Clojure is definitely not pushing FP too hard. It was designed to be especially supportive of FP, but it is definitely a multi-paradigm language.
It seems to me a way to sneak statements into the language. Or does lisp have something like that as well?
It is my first contact with FP, but what I find incredibly cool is the way the data structures are transparently persistent. If it's true this is a rarity in functional languages, I can't imagine using another one.
Let's say you have a map, and you change a value in it. Being a functional programming language, and the map being an immutable structure, you end up with two maps: the old and the new. Now, the cool part is every data-structure in clojure is designed _not_ to do this by copying the whole thing. You'll have two maps who share everything except the changed value. Same with collections, sets, trees etc. The work under the hood must be impressive...
Another nice thing (for me at least, coming from imperative programming) is there is a better difference between a variable and a value. A variable is a placeholder, and a value is ... well, a value. In clojure you treat them separately. A better explanation: http://clojure.org/state