Extracting Parts of Lists

Parts of lists can be extracted by CAR and CDR:


(CAR '(A B C))          =  A
(CAR '((A) B C))        =  (A)
(CAR (CAR '((A) B C)))  =  A
(CAR 'A)     Error: A is not a list.
(CAR NIL)               =  NIL


(CDR '(A B C))          =  (B C)
(CDR '((A) B C))        =  (B C)
(CDR (CDR '(A B C)))    =  (C)
(CDR (CAR '((A) B C)))  =  ()  =  NIL
(CDR 'A)     Error: A is not a list.
(CDR NIL)               =  NIL

Contents    Page-10    Prev    Next    Page+10    Index