(********* Exercice 1 *********) (cons '(A B C) '(1 2 3)) (append '(A B C) '((1 2) 3)) (last '((A 1) (B 2) (C 3))) (drop-right '((A 1) (B 2) (C 3)) 1) (car '((A (B C)) D (E F))) (cdr '((A (B C)) D (E F))) (caddr'((A (B C)) D (E F))) (cons 'NOBODY (cons 'IS '(PERFECT))) (list (add1 2) (sub1 5) 6) (cdr '(a b)) (cdr '(a . b)) '(a . (b . (c . ()))) '(a . (b . (c . d))) (assoc 'bleu '([rouge . red] [vert . green] [bleu . blue] [jaune . pink])) (********* Exercice 2 *********) ;; Replace '?' character by a combination of 'car' and 'cdr' commands ;; (and friends) to retrieve the correct element of the list (? '(A B C D)) ;; -> D (? '((A (B C)) E)) ;; -> C (? '(((DIEU) ENCORE) UNE)) ;; -> DIEU (? '(((DIEU) ENCORE) UNE)) ;; -> ENCORE (********* Exercice 3 *********) (********* Exercice 4 *********) (********* Exercice 5 *********) (define liste1 '(a b c)) (define liste2 '(b c)) (define liste3 (cons 'a liste2)) (eqv? (cdr liste1) liste2) (eqv? (cdr liste3) liste2) (equal? (cdr liste1) liste2) ../Scheme/equality-functions.source (********* Exercice 6 *********) (********* Exercice 7 *********) (********* Exercice 8 *********) (********* Exercice 9 *********)