next up previous
Next: Variables Up: Emacs Lisp, The Language Previous: Special Forms

Primitive and Built-in Functions

Emacs is written in two languages: C and Elisp. The bulk of the C code is the implementation of a lisp interpreter, some display stuff, and the implementation of a core set of Lisp functions (i.e. routines that can be called from an Elisp program). The rest of the editor functionality is written in Elisp. The routines callable from Elisp programs, yet written in C are called ``primitive'' or ``built-in'' functions. From a user point of view, there is only one key difference between the two, although it is not of interest to the beginner. In Lisp, one can re-define functions, by simply declaring another function with the same name, just as if the function did not exist in the first place. This is very convenient, but one must exercise caution while doing this. If a primitive function is re-defined in a lisp program, then all subsequent lisp invocations of that function will be to the new definition, but all subsequent invocations of the function in C code will still be to the C implementation. One does not have to be to Richard M. Stallman to understand that this can have unintended results.


next up previous
Next: Variables Up: Emacs Lisp, The Language Previous: Special Forms
Sriram Karra
2005-01-06