3 ms·
Why do people think Lisp is a functional programming language? If anything, traditional Lisp is the antithesis of a functional programming language. What Lisps
by adrianm 13y ago
Why do people think Lisp is a functional programming language? If anything, traditional Lisp is the antithesis of a functional programming language. What Lisps are you referring to?
Maybe we're just defining our terms differently, but the closest Lisp comes to a functional programming language is Clojure and before that Scheme.
This is not meant to deride Lisp in any way (Clojure is my language of choice, after all) - I think all Lisps enable a fundamentally unique way to reason about programs, but that's a characteristic of Lisp and not of functional programming languages.
- orthecreedence 13y agoI think the biggest thing is that most lisps return values for most things. (if a x y) which is composable to (let ((val (if a x y))) ...) as opposed to (let ((val nil)) (if a (setf val x) (setf val y)) ...) That said, not everything returns value(s), and there's nothing enforcing immutability. I'd say you can be functional in (most?) lisps if you are careful, but the language family is more geared towards general purpose programming than functional.
- barrkel 13y agoPeople think of Lisp as an implementation of lambda calculus, which is at the theoretical core of pretty much all functional programming languages.
- nbouscal 13y agoUnfortunately we've overloaded the term 'functional programming' a bit too much. Foundation on the lambda calculus is definitely core to most functional languages, and I see how it would be reasonable to think of that as their defining feature, but it seems that the community has instead gravitated towards 'referential transparency' as the key thing. With the former definition, Lisps are definitely functional; with the latter, most of them are definitely not. Most Lispers I know consider e.g. Common Lisp to be a multi-paradigm language, not a functional one, for this reason.
- lpw25 13y agoLisp is the original functional language. Functional language traditionally meant a language that emphasised functions as values, in particular supporting higher-order functions. Hence the word "functional". More recently, people have confused "functional" with other features of languages like Haskell (sometimes called "purely functional"), leading to some confusion about what defines functional programming. Here's an interesting post about the more recent changes in the phrase's meaning: http://wcook.blogspot.co.uk/2012/07/day-functional-programming-changed.html http://wcook.blogspot.co.uk/2012/07/day-functional-programmi...