问题描述
我想学习lisp语言,因为我的编辑器是emacs,我更喜欢emacs lisp。任何人都可以给我一些建议来学习lisp,emacs lisp,或共同的lisp?
这两者之间的主要区别是什么?
有很多交叉,特别是在初学者层面,所以无论哪一个开始,都将转移到另一个。
一些主要区别: / p>
-
elisp传统上使用动态范围规则; Common Lisp使用词汇范围规则。使用动态范围,一个函数可以访问在调用函数中声明的局部变量,并且一般都没有使用。 Emacs有一个模拟词汇范围的 c> c
-
elisp不提供尾调用优化。
I want to learn the lisp language, since my editor is emacs, I prefer emacs lisp.
Can anyone give me some suggestions to learn lisp, emacs lisp, or common lisp?
What are the major differences between those two?
There's quite a bit of crossover, especially at the beginner level, so whichever you start with will mostly transfer to the other.
Some of the major differences:
elisp has traditionally used dynamic scoping rules; Common Lisp uses lexical scoping rules. With dynamic scoping, a function can access local variables declared in calling functions and has generally fallen out of favor. Emacs has a lexical-let form that simulates lexical scoping and recent versions of emacs allow optional lexical scoping on a function-by-function basis.
elisp doesn't have closures, which makes composing functions and currying difficult. There's a apply-partially function that works similarly to currying. Note that the lexical-let form introduced in Emacs 24 makes it possible to produce closures via lexical scoping.
Much of the Common Lisp library that has been built up over time isn't available in elisp. A subset is provided by the elisp cl package
elisp doesn't do tail-call optimization.
这篇关于Emacs Lisp和Common Lisp之间的主要区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!