Lisp是不是一种函数式编程语言? [英] Is it true that Lisp is not a functional programming language?

查看:382
本文介绍了Lisp是不是一种函数式编程语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在书中读到:编程大师,对Guido Van Rossum的采访说:


更多基本属性Python与Lisp共享(不是函数式语言!)是函数是第一类对象 ...




所以,Lisp是不是函数式编程语言?



Guido是否错误?那么它是什么?

解决方案

几乎我所知道的每一个Lisp都可以用于功能风格的编程)

然而,Lisps更像是多语言的工具包:你可以做功能性编程,OOP,逻辑编程,定义你的自己的DSL的一些怪异的新范例等。

可能最接近函数式编程风格的Lisp是Clojure(它有懒惰的评估,不鼓励OOP,使用不可变的数据结构在整个过程中,限制不受控制的突变(通过STM),在核心库中有相当多的纯/高阶函数等)。

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?

解决方案

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.)

这篇关于Lisp是不是一种函数式编程语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆