bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#12677: 24.2.50; `nreverse' complains that ("foo") is not `listp'


From: Stefan Monnier
Subject: bug#12677: 24.2.50; `nreverse' complains that ("foo") is not `listp'
Date: Thu, 18 Oct 2012 20:55:47 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

> Debugger entered--Lisp error: (wrong-type-argument listp ("c:/drews-lisp-20=
> /CONTRIB/"))

My guess is that the code ended up doing something morally equivalent
to (nreverse '(1 2 . 3)).  Try it and you'll see a similarly confusing
error message.
The reason is that by the time you get to the error, the list has
already been "nreversed" by side-effect, so the arg (which still points
to the cons cell which used to be the first element of the line) now
still points to the same cons-cell, but that cons-cell's cdr has been
set to nil because it was to become the last element of the
returned list.

I've installed a change in trunk which makes the above error include the
problematic non-nil tail, rather than the first element who looks
confusingly normal.


        Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]