On 2011-08-24 19:55 +0200, Timothy Harper wrote:
How do you think would we could best describe this bug to the emacs-devel mailing list? Creating self-referential keycaps causes emacs to crash in certain cases?
Well, not that there's much reason to create self-referential keymaps in any case. (Ahem.) But there are some issues that should be fixed, one of them being a conflict between the backquote and the read syntax for self-referential structures. For an example straight out of the Emacs Lisp Reference Manual, you can write a list that has itself as the second element like this: (setq x '#1=(a #1#)) Substitute the quote with a backquote, though, and Emacs signals the error "Variable binding depth exceeds max-specpdl-size": (setq x `#1=(a #1#)) Then there's the case of self-referential lambda functions. If you write the function below, how will it byte-compile? '#1=(lambda () #1#) As it turns out, it won't: instead of a byte-compiled function that somehow returns itself, we get the max-specpdl-size error again. I think the difficulty with implementing self-referential structures is that they are contrary to a lot of naïve assumptions one would otherwise make about the code. Therefore, no implementation is likely to get it right "by accident"; the implementer has to be consciously aware of the numerous situations that may arise. -- Vegard