Primitive List-Manipulating Functions
> (setq x '(a b c d))
(A B C D)
> (first x) ; FIRST returns 1st elt of list
A
> (rest x) ; REST returns all but 1st.
(B C D)
> x
(A B C D) ; X has not been changed.
> (cons 'a 'b)
(A . B) ; CONS combines two things.
> (cons 'a nil)
(A) ; The result is often a list.
> (cons 'z x)
(Z A B C D)
Previous slide
Next slide
Back to first slide
View graphic version