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.1) (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")))))
15 [else (even (sub1 an))]))
21 [else (odd (sub1 an))])))
28 (define (f x) (g x (+ x 1)))
29 (define (g x y) (f (+ x y)))
45 (define (f x) (+ (* x x) (* 3 x) 15))
55 (define (f x) (+ (* x x) (* 3 x) 14))
69 [else (even (- an 1))]))
75 [else (odd (- an 1))]))
92 (define (f x) (+ (* x x) (* 3 x) 15))
108 (define f x (+ x CONST))
115 (define (g x y z) (f (+ x (* y z))))
122 (local ((define x2 (* x x))
125 (+ (local ((define x2 (* 0 0))
130 ;; sort : list-of-numbers -> list-of-numbers
136 [(empty? alon) empty]
137 [(cons? alon) (insert (first alon)
138 (sort (rest alon)))]))
141 (define (insert an alon)
143 [(empty? alon) (list an)]
145 [(> an (first alon)) (cons an alon)]
146 [else (cons (first alon)
147 (insert an (rest alon)))])]))