unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* lists, plain conses and length
@ 2020-09-04  2:23 T.V Raman
  2020-09-04  2:26 ` Stefan Monnier
  2020-09-04  2:29 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 5+ messages in thread
From: T.V Raman @ 2020-09-04  2:23 UTC (permalink / raw)
  To: emacs-devel


Ran into this while trying to distinguish a cons from a list:

Try this:

(setq a (cons 1 2)) => (1 . 2)
(consp a) => t
(listp a) => t
(length a)=> Debugger entered--Lisp error: (wrong-type-argument listp 2)

Q: how does one distinguish a cons from a list.
The error  message for length may need fixing since it says the
argument passed to it is not a list (it's correct) but then listp is wrong?
-- 
♉ Id: kg:/m/0285kf1  🦮

-- 
♉ Id: kg:/m/0285kf1  🦮

-- 
♉ Id: kg:/m/0285kf1  🦮



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-04 14:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-04  2:23 lists, plain conses and length T.V Raman
2020-09-04  2:26 ` Stefan Monnier
2020-09-04 14:19   ` T.V Raman
2020-09-04  2:29 ` Lars Ingebrigtsen
2020-09-04  8:53   ` tomas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).