Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 326 Bytes

2.25.md

File metadata and controls

21 lines (14 loc) · 326 Bytes

2.25

Question

Give combinations of cars and cdrs that will pick 7 from each of the following lists:

(1 3 (5 7) 9)

((7))

(1 (2 (3 (4 (5 (6 7))))))

Answer

(cdr (car (cdr (cdr l)))) ; (1 3 (5 7) 9)
(car (car l)) ; ((7))
(cdr (cdr (cdr (cdr (cdr (cdr l)))))) ; (1 (2 (3 (4 (5 (6 7))))))