@dexusOops, you are right.
"As an alternative vl-list-length does return true (an int) if it is a list an nil if it's not."
(vl-list-length (list 1 2 3 4) )
4
(vl-list-length nil)
0
Code - Auto/Visual Lisp: [Select]
But then just a type check like Tharwat proposes is much easier.
Alright, I'm going to get another cup of coffee.Code - Auto/Visual Lisp: [Select]
But then just a type check like Tharwat proposes is much easier.
;-)Code - Auto/Visual Lisp: [Select]
Command: (setq lst '(1 . 2))
(1 . 2)
Command: (listp lst)
T
Command: (mapcar 'princ lst)
1; error: bad list: 2
(defun ALE_ListP (x)
(and x (listp x))
)
(ALE_ListP nil) => nil
(ALE_ListP '()) => nil
(ALE_ListP '(1)) => T
(ALE_ListP '(1 . 0)) => T