(cdr list)
Get everything in the list except the first item.
This is the secondary function for taking a list apart. Like the car function, this function returns a portion of the string. This portion includes the second element of the list, along with any remaining elements. For example, if your list contained the points (5.0 3.0 1.0), then using the cdr function would return 3.0 1.0.
Examples
Code | Returns |
---|---|
(setq a '("one" "two" "three" "four") | ("one" "two" "three" "four") |
(setq b (cdr a)) | ("TWO" "THREE" "FOUR") |
NOTE The a of car and the d of cdr can be combined to create a whole host of cadr possibilities:
caaaar | cadaar | cdaaar | cddaar |
caaadr | cadadr | cdaadr | cddadr |
caaar | cadar | cdaar | cddar |
caadar | caddar | cdadar | cdddar |
caaddr | cadddr | cdaddr | cddddr |
caadr | caddr | cdadr | cdddr |
caar | cadr | cdar | cddr |