Looking for some data structures for elisp, I came across this. But then this warns me off -- without specifying exactly what replaces elib. So where do I get packages to do doubly linked lists?

  • 3
    If you are asking the overly general question of how to find replacements for all that was in that grab-bag, then the question should be closed as too broad (and you already answered it by the links you gave - nothing "exactly replaces it"). If you are asking for a package that supports doubly linked lists, then rephrase and retitle the question. – Drew Dec 15 '15 at 15:48
  • 1
    The core of elib seems to be stack, queue, doubly linked list, binary, and AVL trees. Should I ask a separate question for each? I was actually hoping somebody knew of a new elib-like package -- similar to how cl-lib replaces cl. I guess there is no such beast? Since my original question is black-or-white, not opinion, I don't see how it is "too broad." Maybe it's "too big?" – 147pm Dec 15 '15 at 16:47
  • The questions specific, but any answer would be very broad, since there's not a single package that replaced it. Maybe edit the question to only be about the parts you need? – user2699 Dec 15 '15 at 18:25

This does seem odd - the link you gave says "Elib has been decommissioned as a separate package since its useful functions have long since been included in Emacs.", but Elib is the first Google result for "emacs doubly linked lists", and I couldn't find anything about them being in Emacs.

I guess the key word there is "useful", which is a bit subjective. But in all my novice lisp programming I've never needed doubly linked lists, and I've never seen any code that uses them.

So I'd say, just use Elib if you need a doubly linked list, and Elib works - it looks like a well documented library. The code is available here - https://github.com/burakbayramli/kod/tree/master/site-lisp/elib. It's interesting to see such an old library - copyright 1991-1995.

  • I assume not only Emacs, but GNU ELPA is meant as well when speaking of "included in Emacs". There is a dict-tree, heap, queue and trie available... – wasamasa Dec 15 '15 at 23:10
  • Interestingly though, even in Melpa there doesn't appear to be a doubly linked list or AVL tree package - I guess people haven't found a need for them in Emacs lisp, though it looks like there are libraries for them in Common Lisp. – Brian Burns Dec 15 '15 at 23:22
  • avl-tree.el is part of Emacs since version 23.1 – npostavs Dec 16 '15 at 2:35
  • . . . and there's that curious "cookie" thing at the (Utah) elib site, which describes "nodal data in a buffer." I'm guessing that was someone's idea of how to modularize elisp. I can't find anything further on it, though. It uses a ddl. . . But in general, I (and probably many others) are weak on data structures, possibly due to poor education (too much hand-waving, not enough thorough grounding and good, real-world examples) and being spoiled by cheap database availability. – 147pm Dec 16 '15 at 4:02
  • 1
    @147pm: I think ewoc would be a builtin equivalent to that "cookie" thing (see also a blog post comparing ewoc to tabulated-list-mode (yet another alternative)) – npostavs Dec 16 '15 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.