Emacs Lisp

A dialect of Lisp used by the Emacs text editor. It includes hordes of functions directed to (go figure) editing text.

Perhaps it is a common route into the Lisp world, since anyone who gets to know Emacs will be exposed to it? Hackers naturally will start hacking, and it does seem to be hack-friendly - at least on the surface.

(Elisp was also the name of a Lisp dialect by Chuck Hedrick (and others?) at Rutgers University. It ran on DEC-20 machines.)

While there are extensions that add Common-Lisp-like functionality to it, it is quite distinct from Common Lisp. In particular it is dynamically scoped rather than lexically scoped. This can cause large amounts of confusion for programmers used to lexical scoping as in Common Lisp. (One reason for this dynamic scoping is said to be that RMS felt it would be easier to write editing code with dynamic scoping. Some people suppose that the real reason was political; to be incompatible with the emerging work on Common Lisp.)

Taken from Lisp newbie since I would like to digress,

[...] I'm hacking elisp because it's nearest and most convenient. I discover it doesn't implement #'func in any meaningful way, given what I've seen of On Lisp and CMUCL.

emacs-lisp is bad for your health

Can you enumerate? So is driving to work, but the C-x C-e thing is very handy. Should I get a "proper lisp IDE"? I like Emacs. 8-(

Try ILISP (or SLIME, which has probably replaced ILISP for most people) - it's an emacs mode for real lisp, and very nearly as handy as the builtin lisp interaction mode

  • elisp has dynamic scope as above, and this can cause headaches
  • elisp's symbols are case sensitive (This seems good to me. Why does CL waste time doing stricmp when strcmp is a smidge faster?)
    CL's symbols are case-sensitive too. It's just that the reader upper-cases everything by default. Try (eq '|abc| 'abc) sometime.
    Uppercase in the English sense - in turkish, the uppercase of 'i' is not 'I'
  • elisp at v21.2 does not implement tail recursion, but this is merely an efficiency problem. Doesn't stop you writing TR-able code.
  • elisp has no package system, which causes namespacing issues. You might counter that this `doesn't bite you until you have a large program', but you're sharing that namespace with all the other lisp in emacs, and emacs already is a large program ... Currently, packages solve that by prepending [packagename]- before their identifiers. Emacs hackers are used to having very long identifiers to type.
  • elisp has sucky arithmetic: no bignums, no rationals, silent overflow. (/ 6 4) => 1 - what's with that?
    Looks like an int to me. That won't bother the C programmers, but I can see it's much less neat than returning 3/2.
  • elisp has sucky GC too, from what I understand

Emacs Wiki: https://www.emacswiki.org/

Despite the long list of technical imperfections, I find programming in Emacs Lisp extremely pleasant. There is some very neat interaction between the language and the editor. For example, if you are using Emacs buffers as "network buffers" (i.e. containing data for you to decode), then you can do nice things like single-step code in the debugger while watching how the point moves around in the network buffer containing a message you're decoding. I love it! -- LukeGorrie