type
type
( listof X)
t
t
nil
;if it doesn't end with nil, it's not a true list:nil
> nilnil
nil
(list 1)
(list 1)
nil
Warning: nil happens to be an empty list, a boolean, and a symbol all at once, so be careful when mixing these types together.
t
t
t
If you want to make a list, then y should be a list.
(list 5)
(list 2 4 8)
(list 3 5 7 11 13)
A cons is not always a list. It’s only a list when the rest is also a list.
t
;please never do this:nil
t
nil
nil
t
nil
5
1
"apple"
nil
(list 2 3)
(list "banana" "cherry")
nil
(list 1 2 3)
(list "red" "orange" "yellow" "green" "blue" "purple")
0
3
7
(list 3 5 8)
(list 1 2 3 4 5)
(list 'a 'b 'c)
(list 'a 'b 'c 'd 'e 'f 'g)
nil
(list 3 2 1)
(list 'g 'f 'e 'd 'c 'b 'a)
t
nil
t
nil