Blob


1 ;; The first three lines of this file were inserted by DrScheme. They record metadata
2 ;; about the language level of this file in a form that our tools can easily process.
3 #reader(lib "htdp-intermediate-reader.ss" "lang")((modname 18.1.4) (read-case-sensitive #t) (teachpacks ((lib "draw.ss" "teachpack" "htdp") (lib "arrow.ss" "teachpack" "htdp") (lib "dir.ss" "teachpack" "htdp") (lib "hangman.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "draw.ss" "teachpack" "htdp") (lib "arrow.ss" "teachpack" "htdp") (lib "dir.ss" "teachpack" "htdp") (lib "hangman.ss" "teachpack" "htdp")))))
4 (local ( (define x 5))
5 x)
7 1. (define (x-1 y) (* 3 y))
9 (* (x-1 2) 5)
11 (define (x-1 y) (* 3 y))
13 (* (* 3 2) 5)
15 (* 6 5)
17 30
23 2.
24 (define (f-1 c) (+ (* 9/5 c) 32))
27 (- (f-1 0) (f-1 10))
30 (define (f-1 c) (+ (* 9/5 c) 32))
33 (- (+ (* 9/5 0) 32) (+ (* 9/5 10) 32))
34 (- (+ 0 32) (+ 90/5 32))
35 (- 32 50)
36 -18
39 3. (local (
41 (define (odd?-1 n)
42 (cond
43 [(zero? n) false]
44 [else (even? (sub1 n))]))
46 (define (even?-1 n)
47 (cond
48 [(zero? n) true]
49 [else (odd? (sub1 n))]))
51 )
52 (even?-1 1)
54 )
57 (define (odd?-1 n)
58 (cond
59 [(zero? n) false]
60 [else (even? (sub1 n))]))
62 (define (even?-1 n)
63 (cond
64 [(zero? n) true]
65 [else (odd? (sub1 n))]))
67 (even?-1 1)
69 (cond
70 [false true]
71 [else (odd? 0)])
74 (cond
75 [false true]
76 [else (cond
77 [true false]
78 [else (even? (sub1 0))])])
80 (cond
81 [false true]
82 [else false])
84 false
87 4. (+
90 (local ((define (f x) (g (+ x 1) 22))
91 (define (g x y) (+ x y)))
92 (f 10))
95 555)
97 (+
100 (local ((define (f-1 x) (g (+ x 1) 22))
101 (define (g x y) (+ x y)))
102 (f 10))
105 555)
108 5. (define (h n)
109 (cond
110 [(= n 0) empty]
111 [else (local ((define r (* n n)))
112 (cons r (h (- n 1))))]))
113 (h 2)