(********* Exercice 1 *********) (********* Exercice 2 *********) ((lambda (x y) (+ (* 2 x) y )) 2 3) (filter positive? '(0 1 0 2 0 3 0 0 0)) (filter (lambda (x) (= x 3)) '(0 1 2 3 0 1 2 3)) (map (lambda (x) (* 2 x)) '(1 2 3)) (********* Exercice 3 *********) (********* Exercice 4 *********) (how-many even? '(1 5 7 6 2)) ;; -> 2 (how-many number? '(2 3 4 a b 5 t + 8)) ;; -> 5 (********* Exercice 5 *********) (define matrix '((11 12 13 14) (21 22 23 24) (31 32 33 34))) (define matrix-t '((11 21 31) (12 22 32) (13 23 33) (14 24 34))) (********* Exercice 6 *********) (********* Exercice 7 *********) ;; Returns the list (f(x1) f(x2) ... f(xn)) (define (append-map f l) (apply append (map f l))) (append-map (lambda (x) (list x (* x x))) '(1 2 3 4)) ; --> (1 1 2 4 3 9 4 16) (map-select (lambda (x) (/ 1 x)) '(a 2 0 4 10) (lambda (x) (and (number? x) (not (zero? x))))) ; --> (1/2 1/4 1/10)