Variadic Comparisons in Emacs Lisp

One of the ways that Emacs Lisp differs from other Lisps is that it doesn’t support multiple arguments for comparisons. That is, you can’t write things like

(if (= a b c) do-this else-do-that)

or

(when (< a b c) ...)

You can still express those comparisons, of course, but you have to connect two or more two-argument comparisons with and.

Now, as Bozhidar Batsov points out, that’s about to change. Emacs 24.4 will support variadic comparisons. That’s not a huge change but it does bring Elisp in line with other Lisps and makes it easier to express complex comparisons concisely and clearly. As I wrote before, I’m really impressed with this release and looking forward to its availability.

This entry was posted in Programming and tagged . Bookmark the permalink.