-
Notifications
You must be signed in to change notification settings - Fork 0
/
edits.txt
201 lines (164 loc) · 6.18 KB
/
edits.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
=======
https://htdp.org/2023-8-14/notes/note_teaching.html
'Once a student of a language can form sentences, he/she also need a way to understanding the meaning of sentences.'
->
'Once a student of a language can form sentences, he/she also needs a way to understand the meaning of sentences.'
'You may now suggest that the two words are define in the definitions area:'
->
'You may now suggest that the students define the two words in the definitions area:'
=======
=======
https://htdp.org/2023-8-14/Book/part_prologue.html
'select Add Teachpack from the Language menu and choose image from the Preinstalled HtDP/2e Teachpack menu.'
->
'select Add Teachpack from the Language menu and choose 2htdp/image.rkt from the Preinstalled HtDP/2e Teachpack menu.'
'select Add Teachpack from the Language menu and choose universe from the Preinstalled HtDP/2e Teachpack menu.'
->
'select Add Teachpack from the Language menu and choose universe.rkt from the Preinstalled HtDP/2e Teachpack menu.'
=======
=======
https://htdp.org/2023-8-14/Book/part_one.html#%28part._ch~3afuncs-progs%29
'Exercise 32. Most people no longer use desktop computers just to run applications but also employ cell phones, tablets, and their cars’ information control screen.'
->
'Exercise 32. Most people no longer use only desktop computers to run applications but also employ cell phones, tablets, and their cars’ information control screen.'
=======
=======
https://htdp.org/2023-8-14/Book/part_one.html#%28part._ch~3ahtdp%29
```
(define WIDTH-OF-WORLD 200)
(define WHEEL-RADIUS 5)
(define WHEEL-DISTANCE (* WHEEL-RADIUS 5))
Note how the second constant is computed from the first.
```
Could define WHEEL-RADIUS using WIDTH-OF-WORLD.
The line `Note how the second constant is computed from the first.` is a little confusing b/c there are three constants, and the third is computed from the second, rather than the second from the first.
=======
=======
https://htdp.org/2023-8-14/Book/part_one.html#%28part._sec~3adesign-itemization%29
door-closer uses string=?
(define (door-closer state-of-door)
(cond
[(string=? LOCKED state-of-door) LOCKED]
[(string=? CLOSED state-of-door) CLOSED]
[(string=? OPEN state-of-door) CLOSED]))
The values in DoorState are symbolic -- LOCKED, CLOSED, OPEN.
I claim door-closer should use equal? rather than string=?, since
the states are symbolic and the string value is an implementation detail.
Before the section with door-closer, an example uses equal? and has Aside:
```
The equal? function in figure 27 compares two arbitrary values,
regardless of what these values are.
Equality is a complicated topic in the world of programming.
```
That section includes a warning about relying on implementation details:
```
Figure 27 displays two different functions that switch the state of a traffic light in a simulation program. Which of the two is properly designed using the recipe for itemization? Which of the two continues to work if you change the constants to the following
(define RED "red")
(define GREEN "green")
(define YELLOW "yellow")
```
=======
=======
https://htdp.org/2023-8-14/Book/part_one.html
'''
Exercise 69. Draw box representations for the solution of exercise 65.
'''
->
'''
Exercise 69. Draw box representations for the solution of exercise 66.
'''
Exercise 65 gives only the box type and field names.
Solving exercise 66 gives concrete instances of structure types.
The concrete instances from solving exercise 66 give values to put in boxes in box representation.
=======
=======
https://htdp.org/2023-8-14/Book/part_one.html
'''
Thus,
(define-struct vel [deltax deltay])
DrRacket adds these two laws to its knowledge:
'''
->
'''
Thus, for
(define-struct vel [deltax deltay])
DrRacket adds these two laws to its knowledge:
'''
========
========
https://htdp.org/2023-8-14/Book/part_one.html#%28part._sec~3aworlds-mix%29
This section suggests several design problems for world program
->
This section suggests several design problems for world programs
========
========
https://docs.racket-lang.org/htdp-langs/beginner.html#%28form._%28%28lib._lang%2Fhtdp-beginner..rkt%29._check-range%29%29
slope-of
->
slope
`differentiate` calls `slope`. Example defines `differentiate` and `slope-of`.
Example does not define `slope`. So, I claim `(define (slope-of ...` should be `(define (slope ...`
========
========
https://htdp.org/2023-8-14/Book/part_two.html#%28part._sec~3alists-programming%29
Again, the answer case must be #true because the list contains "Flatt".
->
Again, the answer must be #true because the list contains "Flatt".
or
Again, the answer in this case must be #true because the list contains "Flatt".
========
========
https://htdp.org/2023-8-14/Book/part_two.html#%28part._sec~3alists-programming%29
After all, the above two definitions describe all list of numbers;
-> ?
After all, the above two definitions describe all lists of numbers;
Not sure what is intended here.
========
========
adds the image of a shot for each y on w
->
adds the image of a shot for each y on w
remove extra space
========
========
; adds each shot y on w at (XSHOTS,y} to BACKGROUND
->
; adds each shot y on w at (XSHOTS,y) to BACKGROUND
I don't recognize the `}` as a syntax element related to coordinates
and it is inconsistent with earlier section:
```
; adds the image of a shot for each y on w
; at (MID,y) to the background image
```
========
=======
https://htdp.org/2023-8-14/Book/part_two.html
(define (wage*.v2 an-low)
(cond
[(empty? an-low) ...]
[(cons? an-low)
(... (first an-low) ...
... ... (work-employee (first an-low)) ...
... ... (work-rate (first an-low)) ...
... ... (work-hours (first an-low)) ...
(wage*.v2 (rest an-low)) ...)]))
->
(define (wage*.v2 an-low)
(cond
[(empty? an-low) ...]
[(cons? an-low)
(... (first an-low) ...
... (work-employee (first an-low)) ...
... (work-rate (first an-low)) ...
... (work-hours (first an-low)) ...
(wage*.v2 (rest an-low)) ...)]))
remove extra `...` at the beginning of three lines
========
=======
https://htdp.org/2023-8-14/Book/part_two.html
We name the functions words-on-line
->
We name the function words-on-line
remove 's' at end of 'function' since we name only one function
========
=======