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.8.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")))))
4 (local (
5 (define x (* y 3))
6 )
8 (* x x))
10 (local (
12 (define (odd an)
13 (cond
14 [(zero? an) false]
15 [else (even (sub1 an))]))
18 (define (even an)
19 (cond
20 [(zero? an) true]
21 [else (odd (sub1 an))])))
24 (even a-nat-num))
26 (local (
28 (define (f x) (g x (+ x 1)))
29 (define (g x y) (f (+ x y)))
31 )
34 (+ (f 10) (g 10 20))
36 )
38 (local (
39 (define x 10)
40 (y (+ x x)))
41 y)
43 (local (
45 (define (f x) (+ (* x x) (* 3 x) 15))
46 (define x 100)
47 (define f@100 (f x))
49 )
52 f@100 x)
54 (local (
55 (define (f x) (+ (* x x) (* 3 x) 14))
56 (define x 100)
57 (define f (f x)))
58 f)
60 1. (define A-CONSTANT
61 (not
64 (local (
66 (define (odd an)
67 (cond
68 [(= an 0) false]
69 [else (even (- an 1))]))
72 (define (even an)
73 (cond
74 [(= an 0) true]
75 [else (odd (- an 1))]))
77 )
80 (even a-nat-num)
82 )
84 ))
85 2. (+ (local ((define (f x) (+ (* x x) (* 3 x) 15))
86 (define x 100)
87 (define f@100 (f x)))
88 f@100)
89 1000)
90 3. (local ((define CONST 100)
91 (define f x (+ x CONST)))
92 (define (g x y z) (f (+ x (* y z)))))