News for hackers. Stuff that matters.
Re:Clojure is imperative as opposed to declarative by craigching on Saturday August 23, 2014 @04:43PM (#8216816)
> It's useless to categorize things as imperative or declarative without defining those words.

Yes because his use of the terms "imperative" and "declarative" are not the way I generally use them. When talking languages, I always thought you had imperative, functional, and declarative. Clojure is functional because of it's use of concepts like "functions are first order objects", closure, higher order functions, etc. I would never consider Clojure imperative.

EDIT: Possibly with the use of core.logic you could argue that it is "declarative" if you wanted to ;)

Re:Clojure is imperative as opposed to declarative by MonkeyIsNull on Saturday August 23, 2014 @05:03PM (#8216859)
> Clojure is functional because of it's use of concepts like "functions are first order objects", closure, higher order functions, etc. I would never consider Clojure imperative.

I would agree with that. Putting Clojure in the imperative camp seems a little skewed.

From the front page of clojure.org "Clojure is predominantly a functional programming language, and features a rich set of immutable, persistent data structures."

But I don't think that's his point as seancorfield pointed out.

Re:Clojure is imperative as opposed to declarative by cygx on Saturday August 23, 2014 @05:35PM (#8216932)
> I always thought you had imperative, functional, and declarative

That's not how I see it (but of course this largely depends on your definitions).

The main paradigms are imperative and declarative (think Assembler vs. Prolog if you want to go to the extremes).

'Functional' describes the language at a different level, as does 'object-oriented'.

If you go down to the core ideas, being functional is a declarative concept (mathematical functions are relations between sets), and object-oriented an imperative concept (objects are an abstraction over mutable state).

However, that's not necessarily how these concepts appear in practice (a function call is an instruction to trigger a compuation, the set of messages understood by an object declares its interface), and almost all programming languages are multi-paradigm anyway.