1

Are there any good packages for Emacs that implement doubly-linked lists? I know I could make them myself, but I'd rather not re-invent the wheel.

Drew
  • 75,699
  • 9
  • 109
  • 225
Moyamo
  • 388
  • 2
  • 7
  • Most elisp code out there does fine with single-linked lists, so that might be why you didn't find any yet. – wasamasa Oct 18 '17 at 17:47
  • Not sure this is a great question for SE. You might get some help here, but have you tried googling? What have you tried so far? – Drew Oct 18 '17 at 18:15

1 Answers1

1

Interestingly I had the same question recently. The only library I found is the now defunct Elib project (http://www.math.utah.edu/docs/info/elib_4.html#SEC14) (some discussion and another person commenting about DLL's here). Although the project is now unmaintained, you can still obtain the source from ftp://ftp.lysator.liu.se/pub/emacs/.

A word of warning: Since DLL's are a non-trivial datastructure be prepared for Emacs to hang up to several minutes when it tries to barf a stack trace containing your DLL.

I cleaned up the DLL code a little bit with a mind to publish on MELPA, but it will probably be a while before I find the time to finish it.

ebpa
  • 7,319
  • 26
  • 53
  • > Since DLL's are a non-trivial datastructure be prepared for Emacs to hang up to several minutes when it tries to barf a stack trace containing your DLL. Why would emacs do that? – Moyamo Oct 19 '17 at 06:19
  • @Moyamo I'm not an expert on the internal print functions, but my understanding is it is due to Emacs resolving common object references when traversing the object to print in addition to the normal performance hit when displaying lines that are absurdly long. – ebpa Oct 19 '17 at 06:40