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

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

'length' function for lists and cons cells?


From: Thorsten Jolitz
Subject: 'length' function for lists and cons cells?
Date: Thu, 21 Mar 2013 19:21:29 +0100
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.2 (gnu/linux)

Hi List, 

which function could I use when I map an alist e.g. with dolist, that
contains both types of associations as shown below: cons cells, or lists
with 3 or more elements?

'length' doesn't work on cons cells:

,------------------------
| (length '("a" "b" "c"))
| 3
`------------------------

,--------------------------------------------------------------
| (length '("a" . "c"))
| 
| Debugger entered--Lisp error: (wrong-type-argument listp "c")
|   length(("a" . "c"))
`--------------------------------------------------------------

-- 
cheers,
Thorsten





reply via email to

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