differentiate cons & list
Posted: Fri Dec 07, 2012 11:53 am
I want to know when an item is a cons and when it is a list
> t
>t
>t
>t
> error not a list
Code: Select all
(consp (cons 1 1))
Code: Select all
(listp (cons 1 1))
Code: Select all
(consp (list 1 1))
Code: Select all
(listp (list 1 1))
Code: Select all
(nth 1 (cons 1 1))