问题
I read in the book: "Masterminds of programming" , the the interview with Guido Van Rossum says:
The more fundamental property Python shares with Lisp ( not a functional language either! ) is that functionas are first-class objects...
So, Lisp is not a functional programming language?
Is Guido wrong? What is it then?
回答1:
Pretty much every Lisp I know of can be used to program in a functional style (all you really need are first-class functions, after all!)
However, Lisps are more like multi-language toolkits: you can do functional programming, OOP, logic programming, define your own DSL for some whacky new paradigm etc.
The Lisp that is probably closest to a functional programming style is Clojure (it has lazy evaluation, discourages OOP, uses immutable data structures throughout, restricts uncontrolled mutation (via STM), has quite a lot of pure / higher order functions in the core library etc.)
回答2:
There are languages that allow and encourage functional programming paradigms. Both Python and Lisp are among these. Lisp in particular was the first one to apply theoretical concepts derived from lambda calculus. In the late 1950s, when almost only FORTRAN and Lisp existed, Lisp was highlighted as the functional one, where FORTRAN, with a fully static memory management, would never be considered functional.
However, neither Python nor Lisp enforce pure functionality, allowing mutable variables, states and imperative constructs. A mixture of styles can always be handy in practice, so probably you will not find many example of pure concepts in very successful tools.
Among purely functional languages, Haskell, Clean and Miranda are listed examples, but I cannot say anything about them.
来源:https://stackoverflow.com/questions/6021649/is-it-true-that-lisp-is-not-a-functional-programming-language