What are the major differences between Emacs Lisp and Common Lisp? [closed]

岁酱吖の 提交于 2019-12-02 19:01:55
ataylor

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.

These Emacs-Wiki pages offer some info about the relation between the two Lisps and their differences:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!