Blame


1 12687dd9 2023-08-04 jrmu ;; The first three lines of this file were inserted by DrScheme. They record metadata
2 12687dd9 2023-08-04 jrmu ;; about the language level of this file in a form that our tools can easily process.
3 12687dd9 2023-08-04 jrmu #reader(lib "htdp-intermediate-reader.ss" "lang")((modname 20.2.4) (read-case-sensitive #t) (teachpacks ((lib "draw.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "draw.ss" "teachpack" "htdp")))))
4 12687dd9 2023-08-04 jrmu Exercise 20.2.4. Formulate general contracts for the following functions:
5 12687dd9 2023-08-04 jrmu
6 12687dd9 2023-08-04 jrmu sort, which consumes a list of items and a function that consumes two items (from the list) and produces a boolean; it produces a list of items.
7 12687dd9 2023-08-04 jrmu
8 12687dd9 2023-08-04 jrmu map, which consumes a function from list items to Xs and a list; it produces a list of Xs.
9 12687dd9 2023-08-04 jrmu
10 12687dd9 2023-08-04 jrmu project, which consumes a list of lists and a function from lists to Xs; it produces a list of Xs.
11 12687dd9 2023-08-04 jrmu
12 12687dd9 2023-08-04 jrmu Compare with exercise 20.2.2. Solution
13 12687dd9 2023-08-04 jrmu
14 12687dd9 2023-08-04 jrmu ;sort : (listof numbers) (number number -> boolean) -> (listof numbers)
15 12687dd9 2023-08-04 jrmu
16 12687dd9 2023-08-04 jrmu ;map : (number -> number) (listof numbers) -> (listof numbers)
17 12687dd9 2023-08-04 jrmu
18 12687dd9 2023-08-04 jrmu ;project : (listof (listof symbols)) ((listof symbols) -> symbols) -> symbols
19 12687dd9 2023-08-04 jrmu