Language Features
Notably, the "cl" package implements a fairly large subset of Common Lisp.
Emacs Lisp uses dynamic scope, offering static (or lexical) as an option starting from version 24. It can be activated by setting the file local variable lexical-binding
.
In dynamic scoping, if a programmer declares a variable within the scope of a function, it is available to subroutines called from within that function. Originally, this was intended as an optimization; lexical scoping was still uncommon and of uncertain performance. Dynamic scoping was also meant to provide greater flexibility for user customizations. However, dynamic scoping has several disadvantages. Firstly, it can easily lead to bugs in large programs, due to unintended interactions between variables in different functions. Secondly, accessing variables under dynamic scoping is generally slower than under lexical scoping.
Also, the lexical-let
macro in the "cl" package does provide effective lexical scope to Emacs Lisp programmers, but while `cl' is widely used, lexical-let
is rarely used. Variables bound with lexical-let
are never released, even if they are never used.
Emacs Lisp (unlike some other Lisp implementations) does not do tail-call optimization. Without this, tail recursions can eventually lead to stack overflow.
The apel library aids in writing portable Emacs Lisp code, with the help of the polysylabi platform bridge.
Read more about this topic: Emacs Lisp
Famous quotes containing the words language and/or features:
“It is impossible to dissociate language from science or science from language, because every natural science always involves three things: the sequence of phenomena on which the science is based; the abstract concepts which call these phenomena to mind; and the words in which the concepts are expressed. To call forth a concept, a word is needed; to portray a phenomenon, a concept is needed. All three mirror one and the same reality.”
—Antoine Lavoisier (17431794)
“However much we may differ in the choice of the measures which should guide the administration of the government, there can be but little doubt in the minds of those who are really friendly to the republican features of our system that one of its most important securities consists in the separation of the legislative and executive powers at the same time that each is acknowledged to be supreme, in the will of the people constitutionally expressed.”
—Andrew Jackson (17671845)