#|
Author: Andrew Runka
Student #: 100123456
This is an example piece of code for demonstration of documentation and testing standards.
Ensure lang is set to R5RS to run.
|#
;The Sieve of Eratosthanes is a method for determining prime numbers.
; This program implements the Sieve of Eratosthanes to return a list of the first n prime numbers
; Input: integer -> number of primes to return
; Output: list of prime numbers of length n
(define (sieve n)
;main loop, count up to n primes
(define (iter i primes)
(cond ((= (length primes) n) primes)
((divisBy primes i) (iter (+ i 1) primes))
(else (iter (+ i 1)(append primes (list i))))))
;compare the value i against a list of primes, true if any of them divide evenly
(define (divisBy l i)
(not (= (length (filter l (lambda (x) (= (modulo i x) 0)))) 0)))
;filters a list of values using a given predicate
(define (filter lis pred)
(cond ((null? lis) lis)
((pred (car lis)) (cons (car lis)(filter (cdr lis) pred)))
(else (filter (cdr lis) pred))))
(if (< n 1) ;edge checking
'()
(iter 2 '()))) ; begin the loop
;Testing
;simple cases
(display "(sieve 5)=> “)(newline)
(display “Expected: (2 3 5 7 11)”)(newline)
(display “Actual: “)(sieve 5)(newline)
(display “(sieve 10)=> “)(newline)
(display “Expected: (2 3 5 7 11 13 17 19 23 29)”)(newline)
(display “Actual: “)(sieve 10)(newline)
;edge case
(display “(sieve 1)=> “)(newline)
(display “Expected: (2)”)(newline)
(display “Actual: “)(sieve 1)(newline)
;large number
(display “(sieve 50)=> “)(newline)
(display “Expected: a long list (2 … 229)”)(newline)
(display “Actual: “)(sieve 50)(newline)
;outside cases
(display “(sieve 0)=> “)(newline)
(display “Expected: () “)(newline)
(display “Actual: “)(sieve 0)(newline)
(display “(sieve -1)=> “)(newline)
(display “Expected: ()”)(newline)
(display “Actual: “)(sieve -1)(newline)
#|
Author: Andrew Runka
Student #: 100123456
This is an example piece of code for demonstration of documentation and testing standards.
Ensure lang is set to R5RS to run.
|#
;The Sieve of Eratosthanes is a method for determining prime numbers.
; This program implements the Sieve of Eratosthanes to return a list of the first n prime numbers
; Input: integer -> number of primes to return
; Output: list of prime numbers of length n
(define (sieve n)
;main loop, count up to n primes
(define (iter i primes)
(cond ((= (length primes) n) primes)
((divisBy primes i) (iter (+ i 1) primes))
(else (iter (+ i 1)(append primes (list i))))))
;compare the value i against a list of primes, true if any of them divide evenly
(define (divisBy l i)
(not (= (length (filter l (lambda (x) (= (modulo i x) 0)))) 0)))
;filters a list of values using a given predicate
(define (filter lis pred)
(cond ((null? lis) lis)
((pred (car lis)) (cons (car lis)(filter (cdr lis) pred)))
(else (filter (cdr lis) pred))))
(if (< n 1) ;edge checking
'()
(iter 2 '()))) ; begin the loop
;Testing
;simple cases
(display "(sieve 5)=> “)(newline)
(display “Expected: (2 3 5 7 11)”)(newline)
(display “Actual: “)(sieve 5)(newline)
(display “(sieve 10)=> “)(newline)
(display “Expected: (2 3 5 7 11 13 17 19 23 29)”)(newline)
(display “Actual: “)(sieve 10)(newline)
;edge case
(display “(sieve 1)=> “)(newline)
(display “Expected: (2)”)(newline)
(display “Actual: “)(sieve 1)(newline)
;large number
(display “(sieve 50)=> “)(newline)
(display “Expected: a long list (2 … 229)”)(newline)
(display “Actual: “)(sieve 50)(newline)
;outside cases
(display “(sieve 0)=> “)(newline)
(display “Expected: () “)(newline)
(display “Actual: “)(sieve 0)(newline)
(display “(sieve -1)=> “)(newline)
(display “Expected: ()”)(newline)
(display “Actual: “)(sieve -1)(newline)
#|
Author: Andrew Runka
Student #: 100123456
This is an example piece of code for demonstration of documentation and testing standards.
Ensure lang is set to R5RS to run.
|#
;The Sieve of Eratosthanes is a method for determining prime numbers.
; This program implements the Sieve of Eratosthanes to return a list of the first n prime numbers
; Input: integer -> number of primes to return
; Output: list of prime numbers of length n
(define (sieve n)
;main loop, count up to n primes
(define (iter i primes)
(cond ((= (length primes) n) primes)
((divisBy primes i) (iter (+ i 1) primes))
(else (iter (+ i 1)(append primes (list i))))))
;compare the value i against a list of primes, true if any of them divide evenly
(define (divisBy l i)
(not (= (length (filter l (lambda (x) (= (modulo i x) 0)))) 0)))
;filters a list of values using a given predicate
(define (filter lis pred)
(cond ((null? lis) lis)
((pred (car lis)) (cons (car lis)(filter (cdr lis) pred)))
(else (filter (cdr lis) pred))))
(if (< n 1) ;edge checking
'()
(iter 2 '()))) ; begin the loop
;Testing
;simple cases
(display "(sieve 5)=> “)(newline)
(display “Expected: (2 3 5 7 11)”)(newline)
(display “Actual: “)(sieve 5)(newline)
(display “(sieve 10)=> “)(newline)
(display “Expected: (2 3 5 7 11 13 17 19 23 29)”)(newline)
(display “Actual: “)(sieve 10)(newline)
;edge case
(display “(sieve 1)=> “)(newline)
(display “Expected: (2)”)(newline)
(display “Actual: “)(sieve 1)(newline)
;large number
(display “(sieve 50)=> “)(newline)
(display “Expected: a long list (2 … 229)”)(newline)
(display “Actual: “)(sieve 50)(newline)
;outside cases
(display “(sieve 0)=> “)(newline)
(display “Expected: () “)(newline)
(display “Actual: “)(sieve 0)(newline)
(display “(sieve -1)=> “)(newline)
(display “Expected: ()”)(newline)
(display “Actual: “)(sieve -1)(newline)
(#%require test-engine/racket-tests) ;you are permitted to use this import in your assignment
#| Purpose: Return a list containing the first n prime n numbers
in: a non-negative integer n, specifies how long the output list will be
out: a list of the first n prime numbers in ascending order
|#
(define (sieve n)
(define (iter i primes)
(cond ((= (length primes) n) primes)
((divisBy primes i) (iter (+ i 1) primes))
(else (iter (+ i 1)(append primes (list i))))))
(define (divisBy l i)
(not (= (length (filter l (lambda (x) (= (modulo i x) 0)))) 0)))
(define (filter lis pred)
(cond ((null? lis) lis)
((pred (car lis)) (cons (car lis)(filter (cdr lis) pred)))
(else (filter (cdr lis) pred))))
(iter 2 ‘()))
(sieve 5)
(display “\n\n”) ;just some spacing between prior outputs and test cases
#|
At the start of your file make sure you have (#%require test-engine/racket-tests) and (test) at the end.
The format for tests is as follows:
(check-expect (function-call params) expected-value)
(check-within (another-function-call params) expected-value accepted-error)
check-within must be used for any float comparisons, otherwise use check-expect
Note that only return value is considered, so display only output cannot be verified via this method.
|#
;correctly outputs empty list when input 0
(check-expect (sieve 0) ‘())
;correct output for various other inputs
(check-expect (sieve 1) ‘(2))
(check-expect (sieve 5) ‘(2 3 5 7 11))
(check-expect (sieve 10) ‘(2 3 5 7 11 13 17 19 23 29))
;example of check-within
(check-within (/ 2 3) 0.667 0.001)
;examples of tests that would fail:
#|
(check-expect (sieve 10) “literally anything else”) ;wrong value
(check-expect (/ 1 0) “this won’t end well”) ;error
(check-within (/ 2 3) 0.67 0.001) ;expected value is farther than 0.001 from the output value
|#
(test) ;this is necessary for tests to run, desired output to be “All # tests passed!”(#%require test-engine/racket-tests) ;you are permitted to use this import in your assignment
#| Purpose: Return a list containing the first n prime n numbers
in: a non-negative integer n, specifies how long the output list will be
out: a list of the first n prime numbers in ascending order
|#
(define (sieve n)
(define (iter i primes)
(cond ((= (length primes) n) primes)
((divisBy primes i) (iter (+ i 1) primes))
(else (iter (+ i 1)(append primes (list i))))))
(define (divisBy l i)
(not (= (length (filter l (lambda (x) (= (modulo i x) 0)))) 0)))
(define (filter lis pred)
(cond ((null? lis) lis)
((pred (car lis)) (cons (car lis)(filter (cdr lis) pred)))
(else (filter (cdr lis) pred))))
(iter 2 ‘()))
(sieve 5)
(display “\n\n”) ;just some spacing between prior outputs and test cases
#|
At the start of your file make sure you have (#%require test-engine/racket-tests) and (test) at the end.
The format for tests is as follows:
(check-expect (function-call params) expected-value)
(check-within (another-function-call params) expected-value accepted-error)
check-within must be used for any float comparisons, otherwise use check-expect
Note that only return value is considered, so display only output cannot be verified via this method.
|#
;correctly outputs empty list when input 0
(check-expect (sieve 0) ‘())
;correct output for various other inputs
(check-expect (sieve 1) ‘(2))
(check-expect (sieve 5) ‘(2 3 5 7 11))
(check-expect (sieve 10) ‘(2 3 5 7 11 13 17 19 23 29))
;example of check-within
(check-within (/ 2 3) 0.667 0.001)
;examples of tests that would fail:
#|
(check-expect (sieve 10) “literally anything else”) ;wrong value
(check-expect (/ 1 0) “this won’t end well”) ;error
(check-within (/ 2 3) 0.67 0.001) ;expected value is farther than 0.001 from the output value
|#
(test) ;this is necessary for tests to run, desired output to be “All # tests passed!”(#%require test-engine/racket-tests) ;you are permitted to use this import in your assignment
#| Purpose: Return a list containing the first n prime n numbers
in: a non-negative integer n, specifies how long the output list will be
out: a list of the first n prime numbers in ascending order
|#
(define (sieve n)
(define (iter i primes)
(cond ((= (length primes) n) primes)
((divisBy primes i) (iter (+ i 1) primes))
(else (iter (+ i 1)(append primes (list i))))))
(define (divisBy l i)
(not (= (length (filter l (lambda (x) (= (modulo i x) 0)))) 0)))
(define (filter lis pred)
(cond ((null? lis) lis)
((pred (car lis)) (cons (car lis)(filter (cdr lis) pred)))
(else (filter (cdr lis) pred))))
(iter 2 ‘()))
(sieve 5)
(display “\n\n”) ;just some spacing between prior outputs and test cases
#|
At the start of your file make sure you have (#%require test-engine/racket-tests) and (test) at the end.
The format for tests is as follows:
(check-expect (function-call params) expected-value)
(check-within (another-function-call params) expected-value accepted-error)
check-within must be used for any float comparisons, otherwise use check-expect
Note that only return value is considered, so display only output cannot be verified via this method.
|#
;correctly outputs empty list when input 0
(check-expect (sieve 0) ‘())
;correct output for various other inputs
(check-expect (sieve 1) ‘(2))
(check-expect (sieve 5) ‘(2 3 5 7 11))
(check-expect (sieve 10) ‘(2 3 5 7 11 13 17 19 23 29))
;example of check-within
(check-within (/ 2 3) 0.667 0.001)
;examples of tests that would fail:
#|
(check-expect (sieve 10) “literally anything else”) ;wrong value
(check-expect (/ 1 0) “this won’t end well”) ;error
(check-within (/ 2 3) 0.67 0.001) ;expected value is farther than 0.001 from the output value
|#
(test) ;this is necessary for tests to run, desired output to be “All # tests passed!”(define (sieve n)
(define (iter i primes)
(cond ((= (length primes) n) primes)
((divisBy primes i) (iter (+ i 1) primes))
(else (iter (+ i 1)(append primes (list i))))))
(define (divisBy l i)
(not (= (length (filter l (lambda (x) (= (modulo i x) 0)))) 0)))
(define (filter lis pred)
(cond ((null? lis) lis)
((pred (car lis)) (cons (car lis)(filter (cdr lis) pred)))
(else (filter (cdr lis) pred))))
(iter 2 ‘()))
(sieve 5)(define (sqrt x)
(define (square y)
(* y y))
(define (good-enough? guess)
(< (abs (- (square guess) x)) 0.001))
(define (average x y)
(/ (+ x y) 2))
(define (improve guess)
(average guess (/ x guess)))
(define (sqrt-iteration guess)
(if (good-enough? guess)
guess
(sqrt-iteration (improve guess))))
(sqrt-iteration 1.0 x))
(define (foo a)
(define (bar b)
(+ a b))
(bar (* a 2)))
(foo 3)
;(foo 3)
;(define (bar b)(+ 3 b)) (bar (* 3 2))
;(bar (* 3 2))
;(bar 6)
;(+ 3 6)
;9
(define (g x)
(define (f y)
(+ x y))
(+ (f 3)(f 4)))
(g 5)
;(g 5)
;(define (f y)(+ 5 y))(+ (f 3)(f 4))
;(+ (f 3)(f 4))
;(+ (+ 5 3)(+ 5 4))
;(+ 8 9)
;17
(define (outer x)
(define (middle y)
(define (inner x)
(+ x y))
(inner (+ x y)))
(middle (+ x 1)))
(outer 3)
(define (sqrt x)
(define (square y)(* y y))
;(define (good-enough? guess)
; (< (abs (- (square guess) x)) 0.001))
(define (good-enough? guess)
(let ((tolerance 0.001)
(difference (abs (- (square guess) x))))
(< difference tolerance)))
(define (average x y)
(/ (+ x y) 2))
(define (improve guess)
(average guess (/ x guess)))
(define (sqrt-iteration guess)
(if (good-enough? guess)
guess
(sqrt-iteration (improve guess))))
(sqrt-iteration 1.0))
(let ((a 1)
(b (+ 1 1)))
(+ a b))
(define (letExample c)
(let ((a 10)
(b 7))
(+ a b c)))
(letExample 13)
(define (letEx2 x)
(+ (let ((x 3))
(+ x (* x 10)))
x))
(letEx2 5)
#|
(define (letEx3)
(let ((x 3)
(y (+ x 1))) ;error, x is undefined
(* x y)))
|#
(define (letEx3)
(let ((x 3))
(let ((y (+ x 1)))
(* x y))))
(letEx3)
(define (letEx3b)
(let* ((x 3)
(y (+ x 1)))
(* x y)))
(letEx3b)
#|(define (usingDef x)
(if (> x 0)
(begin (define y 7)
(+ x y))))|#
;(usingDef 17)
(define (usingLet x)
(if (> x 0)
(let ((y 7))
(+ x y))))
(usingLet 17)(define (factorial n)
(if (= n 1) 1
(* n (factorial (- n 1)))))
(factorial 5)
;substitution model (recursive process)
;(factorial 5)
;(* 5 (factorial (- 5 1)))
;(* 5 (factorial 4))
;(* 5 (* 4 (factorial 3)))
;(* 5 (* 4 (* 3 (factorial 2))))
;(* 5 (* 4 (* 3 (* 2 (factorial 1)))))
;(* 5 (* 4 (* 3 (* 2 1))))
;(* 5 (* 4 (* 3 2)))
;(* 5 (* 4 6))
;(* 5 24)
;120
(define (factorial2 n)
(define (fac-it counter total)
(if (> counter n)
total
(fac-it (+ counter 1)(* total counter))))
(fac-it 1 1))
;substitution model (iterative process)
;(factorial2 5)
;(fac-it 1 1)
;(fac-it (+ 1 1)(* 1 1))
;(fac-it 2 1)
;(fac-it (+ 2 1)(* 1 2))
;(fac-it 3 2)
;(fac-it (+ 3 1)(* 2 3))
;(fac-it 4 6)
;(fac-it (+ 4 1)(* 6 4))
;(fac-it 5 24)
;(fac-it (+ 5 1)(* 24 5))
;(fac-it 6 120)
;120
;(factorial2 5)
;(fac-it 1 1)
;(fac-it 2 1)
;(fac-it 3 2)
;(fac-it 4 6)
;(fac-it 5 24)
;(fac-it 6 120)
;120
(define (recursion)
(+ 1 (recursion)))
(define (iterative x)
(iterative (+ x 1)))
(define (fib n)
(cond ((= n 0) 0)
((= n 1) 1)
(else (+ (fib (- n 1))
(fib (- n 2))))))
;substitution model
;(fib 5)
;(+ (fib (- 5 1)) (fib (- 5 2)))
;(+ (fib 4) (fib 3))
;(+ (+ (fib 3)(fib 2)) (+ (fib 2)(fib 1)))
;(+ (+ (+ (fib 2)(fib 1))(+ (fib 1)(fib 0))) (+ (+ (fib 1)(fib 0)) 1))
(define (fibit n)
(define (helper c n1 n2)
(if (> c n) n1
(helper (+ c 1) (+ n1 n2) n1)))
(if (< n 2) n
(helper 2 1 0)))
;(fibit 5)
;(helper 2 1 0)
;(helper (+ 2 1) (+ 1 0) 1)
;(helper 3 1 1)
;(helper (+ 3 1) (+ 1 1) 1)
;(helper 4 2 1)
;(helper (+ 4 1) (+ 2 1) 2)
;(helper 5 3 2)
;(helper (+ 5 1) (+ 3 2) 3)
;(helper 6 5 3)
;5
(define (foo x)(+ x 2))
(define (bar y) (y 3))
;substitution model
;(bar foo)
;(foo 3)
;(+ 3 2)
;5
(define (func x)
(if (>= x 0) + -))
(define (pi-sum a b)
(define (pi-term a) (/ 1.0 (* a (+ a 2))))
(define (pi-next a) (+ a 4))
(if (> a b)
0
(+ (pi-term a)
(pi-sum (pi-next a) b))))
(define (sum a b term next)
(if (> a b)
0
(+ (term a)
(sum (next a) b term next))))
(define (sum-int a b)
(define (identity x) x)
(define (inc x)(+ x 1))
(sum 1 100 identity inc)) ;integer sum
(define (sum-cubes a b)
(define (cube x)(* x x x))
(define (inc x)(+ x 1))
(sum 1 100 cube inc)) ;cube sum
(define (pi-sum2 a b)
(define (pi-term a)(/ 1.0 (* a (+ a 2))))
(define (pi-next a)(+ a 4))
(sum 1 1000 pi-term pi-next)) ;pi ssum
(* 8 (pi-sum2 1 100))
;lambda examples
(lambda() (+ 3 4))
((lambda()(+ 3 4)))
(lambda(x) (+ x 3))
((lambda(x)(+ x 3)) (+ 1 2 3 (* 4 5 6)))
((lambda(x y z)(+ (* x y) z)) 2 3 4) ;=> ?
(sum 1 100 (lambda(x)x) (lambda(x)(+ x 1)))
;equivalent…
(define (cube x)(* x x x))
(define cube (lambda(x)(* x x x)))
(define f
(lambda (x y)
(* (+ x y) 2)))
(f 5 4)
((lambda(i j k)(+ (* 3 i)(- j k))) 3 2 1) ;=> 10
(let ((i 3)(j 2)(k 1)) (+ (* 3 i)(- j k))) ;=> 10
((lambda(arg)(arg 2 3)) (lambda(x y)(+ (* 2 x) y))) ;=> 7
;((lambda(arg)(arg 2 3)) (lambda(x y)(+ (* 2 x) y)))
;((lambda(x y)(+ (* 2 x) y)) 2 3)
(define (fun x)
((lambda(y) (if (< x y) x y)) 2))
(fun 3)
(define (myfunction x)
(lambda(y)(+ x y)))
(myFunction 3) ;=> #procedure
((myFunction 3) 2) ;=> 5
;((myFunction 3) 2)
;((lambda(y)(+ x y)) 2)
;(+ x 2) ; ?(define (multiplyBy x)
(lambda(y) (* x y)))
(define double (multiplyBy 2))
(define triple (multiplyBy 3))
(double 2) ;=> 4
(triple 5) ;=> 15
;(define triple (multiplyBy 3))
;(lambda(y) (* 3 y))
;(triple 5)
;(* 3 5)
;15
(((lambda(a) (lambda(b c)(if (> (- b c) a) “pizza” “french fries”))) 5) 11 5)
(define (boxcar h a b)
(lambda(x)(if (and (>= x a)(<= x b)) h 0)))
(define box1 (boxcar 10 3 7))
(box1 5)
;(#%require plot) ;borrowed from racket (not scheme)
;(plot (function box1 0 20))
;(plot (function (boxcar 25 5 10) 0 20))
(define (foo f)
(lambda(x)
(lambda(y)
(lambda(z)
(f x y z)))))
(foo +)
((foo +) 1)
(((foo +) 1) 2)
((((foo +) 1) 2) 3)
(define (bar x y z)(- (* x y)z))
(foo bar)
((((foo bar) 3)4)5)
(define (func a)
((lambda(b) (lambda(c d)(-(* b c)d))) (+ a 3)))
(func 1)
(define closure (func 1))
(closure 2 3)
((func 1) 2 3)
(define ex1 (cons 1 (cons (cons 2 (cons 3 4)) 5)))
(car ex1) ;=> 1
(cdr ex1) ;=> ((2 . (3 . 4)) . 5)
(car (cdr ex1)) ; => (2 . (3 . 4))
;(car (car ex1)) ;=> error
(car (car (cdr ex1))) ;=> 2
(cdr (cdr ex1)) ; => 5
(cadr ex1) ;=> (car (cdr ex1)) => (2 . (3 . 4))
(caadr ex1) ;=> 2
;(define (make-rat num denom)
; (let ((g (gcd num denom)))
; (cons (/ num g) (/ denom g))))
;(define (numerator rat)
; (car rat))
;(define (denominator rat)
; (cdr rat))
(define (make-rat n d)
(let ((g (gcd n d)))
(lambda (x)(if (= x 0)(/ n g)(/ d g)))))
(define (numerator r)
(r 0)
)
(define (denominator r)
(r 1)
)
(define one-third (make-rat 1 3))
(numerator one-third)
(denominator one-third)
(define (print-rat x)
(display (numerator x))
(display “/”)
(display (denominator x))
(newline))
(define (add-rat r1 r2)
(make-rat (+ (* (numerator r1) (denominator r2))
(* (numerator r2) (denominator r1)))
(* (denominator r1)(denominator r2))))
#reader(lib”read.ss””wxme”)WXME0108 ##
#|
This file uses the GRacket editor format.
Open this file in DrRacket version 6.6 or later to read it.
Most likely, it was created by saving a program in DrRacket,
and it probably contains a program with non-text elements
(such as images or comment boxes).
http://racket-lang.org/
|#
32 7 #”wxtext\0″
3 1 6 #”wxtab\0″
1 1 8 #”wximage\0″
2 0 8 #”wxmedia\0″
4 1 34 #”(lib \”syntax-browser.ss\” \”mrlib\”)\0″
1 0 36 #”(lib \”cache-image-snip.ss\” \”mrlib\”)\0″
1 0 68
(
#”((lib \”image-core.ss\” \”mrlib\”) (lib \”image-core-wxme.rkt\” \”mr”
#”lib\”))\0″
) 1 0 16 #”drscheme:number\0″
3 0 44 #”(lib \”number-snip.ss\” \”drscheme\” \”private\”)\0″
1 0 36 #”(lib \”comment-snip.ss\” \”framework\”)\0″
1 0 93
(
#”((lib \”collapsed-snipclass.ss\” \”framework\”) (lib \”collapsed-sni”
#”pclass-wxme.ss\” \”framework\”))\0″
) 0 0 43 #”(lib \”collapsed-snipclass.ss\” \”framework\”)\0″
0 0 19 #”drscheme:sexp-snip\0″
0 0 29 #”drscheme:bindings-snipclass%\0″
1 0 101
(
#”((lib \”ellipsis-snip.rkt\” \”drracket\” \”private\”) (lib \”ellipsi”
#”s-snip-wxme.rkt\” \”drracket\” \”private\”))\0″
) 2 0 88
(
#”((lib \”pict-snip.rkt\” \”drracket\” \”private\”) (lib \”pict-snip.r”
#”kt\” \”drracket\” \”private\”))\0″
) 0 0 34 #”(lib \”bullet-snip.rkt\” \”browser\”)\0″
0 0 25 #”(lib \”matrix.ss\” \”htdp\”)\0″
1 0 22 #”drscheme:lambda-snip%\0″
1 0 29 #”drclickable-string-snipclass\0″
0 0 26 #”drracket:spacer-snipclass\0″
0 0 57
#”(lib \”hrule-snip.rkt\” \”macro-debugger\” \”syntax-browser\”)\0″
1 0 26 #”drscheme:pict-value-snip%\0″
0 0 45 #”(lib \”image-snipr.ss\” \”slideshow\” \”private\”)\0″
1 0 38 #”(lib \”pict-snipclass.ss\” \”slideshow\”)\0″
2 0 55 #”(lib \”vertical-separator-snip.ss\” \”stepper\” \”private\”)\0″
1 0 18 #”drscheme:xml-snip\0″
1 0 31 #”(lib \”xml-snipclass.ss\” \”xml\”)\0″
1 0 21 #”drscheme:scheme-snip\0″
2 0 34 #”(lib \”scheme-snipclass.ss\” \”xml\”)\0″
1 0 10 #”text-box%\0″
1 0 32 #”(lib \”text-snipclass.ss\” \”xml\”)\0″
1 0 1 6 #”wxloc\0″
0 0 61 0 1 #”\0″
0 75 1 #”\0″
0 10 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 0 9
#”Standard\0″
0 75 12 #”Courier New\0″
0 18 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 2 1
#”\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 -1 -1 2 24
#”framework:default-color\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 255 255 255 -1 -1 2
1 #”\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 150 0 150 0 0 0 -1 -1 2 15
#”text:ports out\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 150 0 150 0 0 0 -1 -1 2 1
#”\0″
0 -1 1 #”\0″
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 255 0 0 0 0 0 -1
-1 2 15 #”text:ports err\0″
0 -1 1 #”\0″
1 0 -1 -1 93 -1 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 1
#”\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 175 0 0 0 -1 -1 2 17
#”text:ports value\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 175 0 0 0 -1 -1 2 1
#”\0″
0 -1 1 #”\0″
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 34 139 34 0 0 0 -1
-1 2 27 #”Matching Parenthesis Style\0″
0 -1 1 #”\0″
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 34 139 34 0 0 0 -1
-1 2 1 #”\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 38 38 128 0 0 0 -1 -1 2 37
#”framework:syntax-color:scheme:symbol\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 38 38 128 0 0 0 -1 -1 2 38
#”framework:syntax-color:scheme:keyword\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 38 38 128 0 0 0 -1 -1 2 1
#”\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 194 116 31 0 0 0 -1 -1 2
38 #”framework:syntax-color:scheme:comment\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 194 116 31 0 0 0 -1 -1 2 1
#”\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 37
#”framework:syntax-color:scheme:string\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 35
#”framework:syntax-color:scheme:text\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 39
#”framework:syntax-color:scheme:constant\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 1
#”\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 132 60 36 0 0 0 -1 -1 2 49
#”framework:syntax-color:scheme:hash-colon-keyword\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 132 60 36 0 0 0 -1 -1 2 42
#”framework:syntax-color:scheme:parenthesis\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 132 60 36 0 0 0 -1 -1 2 1
#”\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 36
#”framework:syntax-color:scheme:error\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 1
#”\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 36
#”framework:syntax-color:scheme:other\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 16
#”Misspelled Text\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
#”\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 81 112 203 0 0 0 -1 -1 2
38 #”drracket:check-syntax:lexically-bound\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 81 112 203 0 0 0 -1 -1 2 1
#”\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 178 34 34 0 0 0 -1 -1 2 28
#”drracket:check-syntax:set!d\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 178 34 34 0 0 0 -1 -1 2 37
#”drracket:check-syntax:unused-require\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 36
#”drracket:check-syntax:free-variable\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 1
#”\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 68 0 203 0 0 0 -1 -1 2 31
#”drracket:check-syntax:imported\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 68 0 203 0 0 0 -1 -1 2 47
#”drracket:check-syntax:my-obligation-style-pref\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 178 34 34 0 0 0 -1 -1 2 1
#”\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 116 0 0 0 0 -1 -1 2 50
#”drracket:check-syntax:their-obligation-style-pref\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 116 0 0 0 0 -1 -1 2 48
#”drracket:check-syntax:unk-obligation-style-pref\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
#”\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 139 142 28 0 0 0 -1 -1 2
49 #”drracket:check-syntax:both-obligation-style-pref\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 139 142 28 0 0 0 -1 -1 2
26 #”plt:htdp:test-coverage-on\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
#”\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 1 0 0 0 0 0 0 255 165 0 0 0 0 -1 -1 2 27
#”plt:htdp:test-coverage-off\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 1 0 0 0 0 0 0 255 165 0 0 0 0 -1 -1 4 1
#”\0″
0 70 1 #”\0″
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 4 4 #”XML\0″
0 70 1 #”\0″
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 37 #”plt:module-language:test-coverage-on\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 38
#”plt:module-language:test-coverage-off\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 1 0 0 0 0 0 0 255 165 0 0 0 0 -1 -1 4 1
#”\0″
0 71 1 #”\0″
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 4 1 #”\0″
0 -1 1 #”\0″
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0 0 0 1.0 1.0 1.0 0 0 255 0 0 0 -1
-1 4 1 #”\0″
0 71 1 #”\0″
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0 0 0 1.0 1.0 1.0 0 0 255 0 0 0 -1
-1 4 1 #”\0″
0 71 1 #”\0″
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 0 100 0 0 0 0 -1
-1 4 1 #”\0″
0 71 1 #”\0″
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 255 0 0 0 0 0 -1
-1 2 1 #”\0″
0 70 1 #”\0″
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 148 0 211 0 0 0 -1
-1 2 1 #”\0″
0 70 1 #”\0″
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0 0 0 1.0 1.0 1.0 0 0 255 0 0 0 -1
-1 0 1 #”\0″
0 -1 1 #”\0″
0 12 -1 -1 -1 -1 -1 -1 0 0 1 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #”\0″
0 -1 1 #”\0″
0 12 -1 -1 -1 -1 -1 -1 0 0 1 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #”\0″
0 -1 1 #”\0″
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 200 0 0 0 0 0 -1 -1
0 233 0 17 3 53
#”#| Did everything in the repl, so here’s the readout.”
0 0 17 29 1 #”\n”
0 0 17 3 38 #”Welcome to DrRacket, version 6.6 [3m].”
0 0 17 29 1 #”\n”
0 0 17 3 46 #”Language: R5RS [custom]; memory limit: 128 MB.”
0 0 17 29 1 #”\n”
0 0 17 3 32 #”> (cons 1 (cons 2 (cons 3 ‘())))”
0 0 17 29 1 #”\n”
0 0 17 3 7 #”(1 2 3)”
0 0 17 29 1 #”\n”
0 0 17 3 5 #”> ‘()”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”()”
0 0 17 29 1 #”\n”
0 0 17 3 14 #”> (list 1 2 3)”
0 0 17 29 1 #”\n”
0 0 17 3 7 #”(1 2 3)”
0 0 17 29 1 #”\n”
0 0 17 3 43 #”> (define a (cons 1 (cons 2 (cons 3 ‘()))))”
0 0 17 29 1 #”\n”
0 0 17 3 32 #”> (define b (cons 1 (cons 2 3)))”
0 0 17 29 1 #”\n”
0 0 17 3 3 #”> a”
0 0 17 29 1 #”\n”
0 0 17 3 7 #”(1 2 3)”
0 0 17 29 1 #”\n”
0 0 17 3 3 #”> b”
0 0 17 29 1 #”\n”
0 0 17 3 9 #”(1 2 . 3)”
0 0 17 29 1 #”\n”
0 0 17 3 25 #”> (equal? (list 1 2 3) a)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#t”
0 0 17 29 1 #”\n”
0 0 17 3 25 #”> (equal? (list 1 2 3) b)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#f”
0 0 17 29 1 #”\n”
0 0 17 3 11 #”> (list? a)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#t”
0 0 17 29 1 #”\n”
0 0 17 3 11 #”> (list? b)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#f”
0 0 17 29 1 #”\n”
0 0 17 3 9 #”> (= 3 4)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#f”
0 0 17 29 1 #”\n”
0 0 17 3 9 #”> (= 3 3)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#t”
0 0 17 29 1 #”\n”
0 0 17 3 26 #”> (= (list 1 2)(list 1 2))”
0 0 17 29 1 #”\n”
0 2 26 17 1 #”\0″
4 -1.0 -1.0 0.0 0.0 0 7 2.0 500
(
#”\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\0,\0\0\0000\b”
#”\6\0\0\0j\220\230\341\0\0\v\351IDATh\201\315\231{pT\327}”
#”\200\277{\357\276w\365B`!0\”\6\313(5\17\307vm\234\36206O”
#”\361\24\22\2CRO\333\330-\261]\233x\246\2354\223\264n\306i\332i\332″
#”\3168\236\246\366\244\235\266\203\355`a”
#”l\a\20 \31\2\302\36S\307\216\244″
#”\211A\342\r\2V\217\325\256\366\275\367uN\377\270\222,@H\221\241S~3″
#”\347\237=\277s\317\267\277{\356w\317″
#”\236U\244\224\214\24\233C\336\331>U”
#”;\32\364x\363\334.\27\212\242\214\230″
#”/\245\304\264L\322\206\231\310\tk\376\e)\275u\304\1c\fe$\340\332@”
#”\340!\267\306\aO\214+\n\255\372\223’aF\5x\275\240*\200\2\3\360R”
#”\2\22\204\4]\207\23\307\371\345\177\374″
#”\27oE\373\222\246\315\342\35\231\314\377″
#”\374\237\3\327\4\2\17{\24\331X[\\\24Z\367\315\3150iR?\254\332?”
#”\362\232J\17\\G\b\a\372\322%vm\177\223\267\243}IK(\267\fzX”
#”\340\1\330\232q\5\241\365\233ja\374x\3204\aVs\365Wx\230\20\22l”
#”\313\201\266m\350\356\346\235\35u\324\305″
#”\342IC(K\3522\231c\267\34\270″
#”&\20x\330\255\311\306\232\302\374P\365″
#”\372*\310/\200\336^\314\313\227p\227″
#”L\204\322\211\20\f\202\242\302\0\267\4″
#”\244\200t\32\302a\314\256n\334wN\206q\343 \36g\347\256w\251\353K\244″
#”L[Y|\263\320W\1W\27\4\346z\204l\250*\310\17\325\256Y\5\241<"
#"\210Fy\375\334E:\347-d\334\257>\340\231;Ka\312\24\az\240\322B”
#”:\260\35\35\274z)Lt\321\343Ll:\314″
#”Sw\2259\320\251$;\336\337\315\256\370\315C\253″
) 500
(
#”W\301\332\262\261*?/T\273b\31x\274\320\323\303+W\272(x\356\5\276″
#”\377\322K\334\365\203\227\370IO\24\316″
#”\237\207x\37\344t\247\365\365\301\371\363″
#”\374SO\214\351/\375\220\357\377\315K”
#”\24<\367<\257\\\351\202\236\36\360x"
#"\251]\261\214\252\202\274\220[\225\37T"
#"\27\4\346\336T\205\a`\327\26\204\202"
#"\233\226.\1\277\37\2421^\353\212P"
#"\370\334\v\324\256_?8\340\275\275{"
#"\350\370\273\227\331\22\364QT~7\0\321\223\247x#\2433\365{?`\365\362"
#"\345\203\271;\336y\207\370+\377\302S"
#"\23'@Q!d\263\274u\240\201\367"
#"\342\251\264\241)\213w\3063\37\217\31"
#"\270*\317\377\210G\310\2065\371\301\340"
#"\346\307\26\201?@\374\362e\376\335\206"
#"\322\247\267\262\251\272\372\272A\357\356\331"
#"C\363\313\177K\370\370\347x\\n\306\342g)$\367\2725\16\247\263i\363K"
#"@+K\374\236Tu(\20\370\323y\177\240PX\0\300\277\236\357\240`\353\263"
#"l\336P{\303\201O\216\37\307\206\240\237/\343\347w\343I*4M6d\263"
#"\231\3\31=4\26`W\304\226\301\265\263f:\23\n\tyyt?2\217e"
#"\v\37\35v\200\236N\363L\371t\252\2>V}\343\t(\36\17\311\244\363\320″
#”\301\310~\236p\a\2537o\302\332\376&\357\307\223JR\20\34\v,\200j!”
#”9q\366,\30\6\230&x=l\v\372\330[W\307\271H\344\252\344d,\306″
#”\267\313\247S\251\301\272\2155\220\237\17″
#”\331,$\22\220L9\320\251\324\325-”
#”\235v\372\22\t’\267\260\220\252\r\325″
#”\254\316\17Q\346\322\250\t\4\36\36\23″
#”\260\4L[\220L$\260\223I\210\364″
#”\222od\251\216\365\260w\307\16N\206\303\0\204;:x\376\367*\250\324″
#”$\353\327\257\3\237\37.\\\304lj\202\266v\210\366:@9\335\271\375z”
) 500
(
#”\277A\262Y\247\257\255\r\263\351(\\”
#”\274\b\201\0\353\253\326R[\224\207[”
#”\223\215c\201Vfz\\\362\37\356(”
#”\246\342\216\t\370\275^\334n7\305\245″
#”\23\241\274\234\2307\310\366q\23\270\247″
#”\254\2147\277\365G\254p\251\374\177\373″
#”Y\5\260\245$\253\353\244\262\31\22\251″
#”\24\27\317\236\303\370\364S\2122\tf”
#”\376\346\327\374\347\37~\203\25\232\302\355″
#”\340ge\246\307%_\36_\304\324\374<\334.\27\252\252\240**\232\252\22\1"
#"~v\366\2\313\202>n\27?+\367\272]\362\207\343\v)\313\v\341\32244″
#”UEQ\24:t\203\355\341nV\344\371\271\235\374\354\2gI\230\266\r\200\220″
#”\22EQ\370\351\345NV\a}l\236;\27<\36\260-\336\310\31\224l}v"
#"XX\200u+W\262\353\311o\262\241"
#"\240\340K\373\371\1\2577\320\220\3156\2\303\372y\20\330\22\2\24\5UJL"
#"!\270b\331\334\216~v\36:\34`\313\26dL\213.\335\340v\365\263*\1"
#"C8U5\205\215!lZ&N\346v\365\263j\3\27L\213>\323\302\24\22″
#”\277\313Mv\336\2\6\226J$\32\245’\22\241\367\3349hk\2434\227fs”
#”\264\207\3\273vq`\367n\376\352\367″
#”\357g\271\6\325\253W\201\327\a\3410″
#”\257\267\237\346\307\367=\314\253\355\247\341″
#”\364\31\210\306 \227\e\2\234s>;”
#”}\206W\333\317\360\343\257=\304\353m\247!\334\t>?\325\253WQU\220\37″
#”\32\16Z5\244L\327gu\331\232\323″
#”\211[\26n\227\306\262\236\360 \360\355″
#”\346g\255\304\345\336\335k\213-]B”
#”xB\240\204\220\224\245\222\354\214Dy”
#”,\340#\317\343\6\24\204\24\330B\220Lg8u\372\f?\377\360#*\3^”
#”6.]\342<\230=\21^\273\334\311\370\255\317R["
#"U\5@\371\264i\364\24\217\247qo=\345}1\374"
) 500
(
#"\301\0\344rDO\264\361\363h\234i\177\371]V.^\2\300\275\25_\345\202"
#"?\310G\a\16\360\200\"!\30\344\336"
#"\2622\254\313\227<\247\263\306\23o\376"
#"\375\217\16n\374\356\367.)RJ*\274\336\331i\333n*u\251yK\374^"
#"\345\376\240\237\277\356\216q+\375\334\376"
#"\317\377\310\222\2560 i(\231D\305"
#"\213\177\301\332\25+\256\313}\253\256\216\360k?\343\217]P0y2d3l"
#"?x\210_&\322iSS\26\253\0m\272\336\32P\325\5aK$\e\262\272"
#"\374,\235\35\\\22\246mc\3316f"
#"\177\373\351\345N\346\371=\327\373\371["
#"O\217\350\347\351\177\276\215\306\202\"\32"
#"\v\213)\337\366\342\260\260\0\233jj(y\352i\336\310\31\316/p\217\207-"
#"s\347\262(\340\v$M\273\3215\220\330n\30-3<\236\5W,\321\324\220"
#"\325C\200r+\374<\0205k\326\360\353\251SQT\225\af\315\0321w\356"
#"\302G\371\357\346fH\364:.\367zY;k\246\362oG\217\5\325\241\211\355"
#"\206\321\22T\325\371W,\221\202\233\367"
#"\363\265\361\340\2349\243\302\236\213D\330"
#"\275c\a\333\202>\360z\2349\f\203\23g\317b!Q\257\35\320n\30-\1″
#”U]p\263~\3762q2\34f\317/~\301\206\270sM\”\275\330\311$\311″
#”D\2\323\26H\270\36\30\340\244a4\337\214\237\217wt\20\263mt\300\0L”
#”\300\272\246\231\375}:\20\263m\216w”
#”t\260o\347N\266\304z(\315\245\241″
#”\255\215\336s\347\350\211D\210D\243\330″
#”\375\257r\327u\264\375\321\357\347\200\5″
#”\312lE!\337\357cYO\230z\276\360\263-l4]#}\366\34\23\23\t”
#”\212\356\273\217JCg\317\373\3571o\3512JJKQ5m\360\200″
#”\350\352\315\217s`$l\233\316p\230\246\372z\326D:)\262t\214″
) 500
(
#”\346f:#\275\330\266\215-l\f\323\32\35\330\243j_\277l\331M\373\263z”
#”\236\4ES\25\312\177\353\234\234\212\201″
#”\335\235\242\240\252\2\325\266\351\350\354\””
#”\357H\23\323f\317\346\353]]|\244″
#”iT\326l\300\355\361\214\270\f\f\303″
#”\340\303\206\6\346\177\336\302]\232Bwk+\311L\6[\b\204\24\b\341\314%”
#”F\3n\323\365\326\n\257w~\330\262\233\16\364CK\”H9dwg\333h”
#”REQ$\226\260I\306b\34ol\344\223\222IL^\262\34U\323\30\355\374″
#”Y\3234\212\212\213\371\340\363\343$\272″
#”\303\24\272\335×4\25)\235\275\262-”
#”\4\226\20\330R\”\345\r\326\360P\350″
#”\337\325\317)\335 \234\316p\260t\nw\276\360\”kj6\240\252*R\312\21″
#”\233\252\252\254\333\270\221I\317\177\207\203″
#”\245w\22NgH\351\306\340u\a\346\30X\22#\2\303\27\326\270b\211TC”
#”V\227\3\300\226\20\216Al\233\264a”
#”\320\231\315\361\311\204\211\314x\3469\236″
#”\250\256&\26\217#\204\30\25X\bA,\36g\313\206\r\224o}\226O&\224″
#”\320\231\315\2216\372\241\207T\370w\2″
#”\36\200\36\315\317\307\246N\243l\333wX\260t)\27b1l\333v\226\303H”
#”K\242\37\332\266m.\304b<\272|9S_x\221cS\247\321\255\edL"
#"\v\313\356\af\f\300C+}#?\227o}\206E+*\235\207\245\277\262\320"
#"\177t\334_\311\\.G.\227\373\242\362\203\334N\277-\4\217VVR\376g"
#"\337\246y\342d\fac\n\247\312\206\2207\366\360\215b$?\3373s&\246"
#"i~\1;\344\266\333\266M\244\273\233\275o\277M}]\35\221\236\236\301;0"
#"4W\b\201i\232\3343k\26\331y\v\360\273\334\230B\322gZ"
#"\\0-\354\261\2\303\240\237\257\333?\177|\350\240\363\366\e\0022\0"
) 500
(
#"\233\210\307\371U\375^\226\237jc\351"
#"\311\0234\355\253'\21\217\17\233\233L"
#"$\370\260\261\221e\335a\334.\215\270"
#"e\321\232\323\251\317\352\322\2202}C"
#"\255\335(n\344\347rE\345\240\220\314"
#"[\272\224\242\342b\307\20B\20\215D8\262o\37_9z\230\300\225\16\0\246"
#"\\\276\344\344._\316\270\342b\24E"
#"A\bA\264\267\227\243\373\367S\361\331'\334\361y+\247\322iZ\2629\16d"
#"u\31\266D2\250i\363\307\f|#?Oo\371\f+\225\344\250\242\260\250\262"
#"\222@0H:\235\346\310\276}L\332"
#"\267\233\31\235W\270\230q\2648#\223\301H&iR\24\36[\271r0\267i"
#"\377~\356>r\210)gOq2\32\345\263t\226\206!\260m\272\336:f\340″
#”\1\350\31\36\317\202\260%\2164d\365<@\0212\3124\321N\302\2629(%"
#"3\37|\220\226c\37ST\277\207\212\360%z2Y\f\341\234}\30I\233\n"
#"\273\203\314\236\367\235\334\207\36\242\365\330"
#"1J\01652\345\374\31N\306\372h\316di\274\6\26F\371cq\264\230\341"
#"\361\314I\v\3214\311\245\206\36\367y"
#"\2259\1\37S\v\362\2718u\32\237\316\370*3\233?\345\356\360\25\22\271,"
#"\246\20\203\206S\24p\253*\371>?”
#”\247’M\346\267s\356\347\201\366\23\224″
#”]8\313\371x\234\226\214\316\301\234\3\eP\325\5\355\206\32120\347M\1_”
#”\v\275\310\347Qf\371\274\224\205\202L\b\205\210$S\364\3519L1\374\34n”
#”U\241\320\353c|^\210\236T\212\213\2514\2559\235C9Cv\16\3{K”
#”\200\1\356\361x\356\313\bqd\222K\r-\364y\224\31\0367y\232\206\202\34″
#”\361\275\1N\265%\nI\333\246\31509<\2\354-\3\36\n]"
#"\352RC\363\274\36e\272[\303\257\252\203\336\274\366Hp`V\1d"
) 106
(
#"\205\340\214isTw`\375\252\272\360\244a4\17\373\5o\25\360\0tV\210"
#"\303%.5\357k\36\227R\244\252hC'\273\6\26\300\6bB\360\e\303\222"
#"]\243\300\336r`\200r\267\373\21\e"
#"\331\250B`\224\223\326\301\220\22\4d4E}\374\224a\214\3707\330"
#"\377\2N\327R>\265\216\32\4\0\0\0\0IEND\256B`\202″
) 0 0 17 3 1 #” ”
0 2 28 17 1 #”\0″
4 -1.0 -1.0 0.0 0.0 0 8 2.0 500
(
#”\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\0000\0\0\0000\b”
#”\6\0\0\0W\2\371\207\0\0\17IIDATh\201\265\232yt\25U\236″
#”\307?\267\352\275\274\274%\311#+\222\rD@QD\5T\\\6[A\4\202″
#”\216\242\243-\330\30793\355q\31\373″
#”\214v\333\266\2704m\213\255\366\320\216″
#”\323#\352\364\351szZ\307>\323\16\36\25$\1\24\210\b\262\204E\301\5\2″
#”\262\204@\366\2745o\251\252{\347\217″
#”\252\227<\222\0\211\343\374r\352\335\267"
#"T\335\372~~\277\337\335\352F(\245"
#"\30\256\335\225\227\373`.\372\277\373s"
#"\\B\3274@ \372\237\324\377\v5\330G\205%%\361\264\241z\220\17\3755"
#"\232|m\270Z\304p\1n\313\313}\310\245\264\337O\313\317\23\217-\274\eJ"
#"\212\301\355\6\241\201&l\345\202\2542"
#"\243V\365\225R\201\222`\30\320\336\301"
#"K\377\3656\r\221\250\262\204\374\247\25"
#"\321\344\362\3777\200;\374\336\305B\210"
#"\245\323\203\371
#”\345\327\377\300\326P\4\251\324\223\357\304″
#”\23\317\177\357\0\267\371\275O\352\202\347″
#”\256\n\26\360\310?\334\v#G\202\313″
#”e\213\206\201\345\351,s\277\354\3224″
#”\241\245\205\227\377\370’\266\204\302H\305″
#”\223+\206\b1$\200^\361\5\5
#”\232\263.\36j\4pD\365\304\343\354ih`cm-\257\225\227B”
) 500
(
#”4Ld\363\26\272\”\221^\361J)\244SZR\332\21p\b\\v(\355\23″
#”2\0B\b\224S\332\207\35\241\266\356″
#”\20\311\215\365\24_}\25\313\362ry\264\266\26\241i\\>}:.\227k\b”
#”\322O5\3234\331\263k\27\eV\257\346\225`\0\242\21\332?\375\224HO\17″
#”RIg\355?\20@*\205\375\227\235BJa9O\n\6\2\b\4\366\357]”
#”\261\30]k\326\2220\f\312\317\251`s}\200\213/\275\24\277\337?l\200d”
#”2\311\346\372z*\32\367\263\277\3458″
#”\271n\267\335\273dR\314\21}\n@\346\275S\307)\215\330\222v\357:\30@”
#”\306\22\246Is4FCq\31\211)\227s\347\302\205\337I<\200\337\357\347\316"
#"{\356a\205&x\247\256\203\251\355\255"
#"\214\n\370\361\272\335\210\323\1dR\310"
#"\251C/\321\265%\343\335.\306zrp\351:\b\321\373\243\312x\2;B="
#"\206\301\361h\214\35%e\244\347\316\347"
#"\216E\213\250\32=\32\231y\3163\\\23\202\302\302B*\252G\2637\231\342d"
#"s3y\335\335x4\35M\320+\\:\367\317dI\332\2628\230Ls\3000"
#"\263\1\334\350\316\374\277\27\0\347\371\23"
#"\212\204ap2\336\303\366\3422\314y"
#"\363\271}\341B\312++\221\226\365\235"
#"\274\2371)%\5\301 \25\325\325\354"
#"s \362\303\335\344\350\32\232\343\314\214"
#"\370L;5,\213\203)\243\17`\234[gLN\6 \23\1\325\347y\323\344"
#"DO\202\235\205%X57\263`\321\"\312+*z\303\373}X~A\201\r"
#"\221H\322\332\324\204?\22\302\2439\20J!\25\247D\340P:M\243ae\0"
#"\\6\200\350[\214g\304'L\213\226D\222]\245#1jn\346\266\37\376\220"
#"\212\252*\273/v\304g\372\377a[Vc\5"
#"(\b\6)\257\252\342\213T\232\326\23'\b\204"
) 500
(
#"B\344h\2\r\201\354\355)\25\206\264"
#"\3706m\364\1\214u\273\30\355v\341"
#"\322\234\347\233N\332\244,\213\326d\222"
#"\335\245#\2215\267pG&m\244<\263\260\357hJ)\n\202A*G\217f"
#"_2Eks3\201p\b\217\256!z!$i)\371\32609hX\350\305"
#"\272\266\344\\\227\213j\267\253\267\r8\316!nZ\354(.\305\234;\237\5w"
#"\337\315\250\212\212\323\212?%\n\216g"
#"-\323$\32\215\342\322\365SF\352\354"
#"s\6\203\310\244\323\227\311\24\35'N"
#"02\36\307\255\211\276\24\222\222o\323"
#"&\207L\v\275H\327\226\224\350\32\345"
#"\272F\216\260s\256W\224\20\354\272a6\363\26,\240\252\252j@Os\272\324"
#"\221R\222L&\371b\317\36\336y\373m|~?#\n\v\321t\375\224.9"
#"\333[\3315+)\361\371|\4\213\212\330\35\2160\351\340~g\225\253H[\222"
#"\260i\362\265ar\334\222\350\371\232X\322nIU\246i\302\247\t\334B \20"
#"hBP\226\237G\323\250\n\216G\"\234S^N\216\307cO\31\34\270\301L"
#"9\342\367\356\336\315\372\17?\344\336`"
#"\36+\366|\216/\20\240\250\270\30\335"
#"\351\252\a\275\326\351\216\r\303\240\275\275"
#"\235\215\353\326\221\327\331\301\264\266\223\304"
#"RiR\226$d\2324\246M>J\246UJ)\241\227\350\”\24\221\334t\330″
#”\264(\321\204\360\vp9\r\307\353v”
#”\261\360\302\363\331\331\35f\337\211\223\224″
#”WV\332\20\372\251\23\351\214\34\251\24″
#”\311d\222}\273w\263\261\256\226_\t”
#”\213\363\375^\246\366\304\370\317\306C\370″
#”\2\1\nKJ\320u}\340\326\201\3`83\323\272\225+\t\236<\301b\237"
#"\233c\a\16\20N\246\3506\f\16\244\r\336\355I\251\220T\344j\352\21"
#"\275\323\222\333^\177\356W\341\250d\366\221^\b\201K\b\f\313$v\374"
) 500
(
#"8\267\2357\206\206P\204\257N\2660"
#"\252\262\22Ov$\262\304\247\222I\366\356\331C}m-?MD\21\237\357\342"
#"\350\336\275\270\333Z\231\26,\340/G"
#"\233\360\a\2\24\26\27\333\351\224\r\341"
#"x\276\263\263\2235+W\222\177\3428?s)v\255[GK4F\227#\376"
#"=G\274_S\217\34H[\257\364>\330\32\227\243\377s\217\24\277\vj\202[”
#”|\0361.\307M\320\345\”W\327)\r\4\230r\335\f^T:\211\321\347r”
#”\343\334\271\4\v\vq;C\276T\212t*\305W\373\366\261~\325*~\22\355″
#”\”\347\313}\264F\243\244,\213\34]\247,\20 =\361\”\376\255\240\210\ej”
#”j\230x\321Ev4\235\301\312H\247″
#”\tuw\263\346\303\17\361\35=\302\343″
#”\302`\307\206zN\306\242t\245m\361″
#”\357\367\23\17\375\36-fC\334\354@”
#”\24\350:\271.\235\22\277\237\313\257\270″
#”\202g=\1\214\252jf\327\3240\242″
#”\250\b\227\256\223J\245\370\362\213/\330″
#”P[\313\217\303\235\4\276\374\202\266X”
#”\17)\313\264\237\204\b\360\350v\35\221″
#”\v’\361\307`1\327\317\231\303\205\27″
#”_\214\307\343\3014M\272\272\272X\273″
#”j\25\236\246c<\225\214\260u\3536"
#"Zbq\272\f\203\306\264\301\a\203\210"
#"\37\0\320\37b\276\317#\306\271\335\344"
#"\273tru\235\22\277\217+\247L\3417\201 =U\243\2315o\36\201@\200"
#"\375_}\305\372\17?\344\301P\a9_\355\243-\36'iY}\373z\364A"
#"\224\372\375$\317\277\2007\n\313\270~\336<&L\234H,\26c\355\252U\370"
#"\233\216\362D\244\213\317v\355r\304\2334\32\6+O#~P\200\376\0205>”
#”\2178\317\355\242@\327\361\350:\305>/\23*+y\343\334\t$\252G”
#”3\376\202\v\370d\355Z\356:\334H\321\361ct\364$H[\326\240}”
) 470
(
#”<\200G\327(\362zi9\247\234w\307]\300\337\334x#\a\276\376\32\357\321"
#"#\334w\350\e\276ij\242\255\247\207"
#".\303\344\240a\262\262'\245\302\247\21"
#"\177Z\200\301 \306\272]\344\353:\36"
#"M\243\320\233\313\204\362r\336\2348\231\3Rrw\323\21\2\207\32\351H&I"
#"[g\32\245\25 \310\3214\212rs\tU\217\346\2351\343\30\357\322X\364\345"
#"\347\354on\246\255'A\267ir(m\262*qf\361g\4\310@$\244x"
#"9_\23\252\306\347\21\347\272]\344k"
#"\32\36]\2430\327\313\244\212r\212\253*ih\330IK,NZ\312^\221\247"
#"\3\260\177\265!\312\374>\246]r\t\355’O\360\305\361f\332{\22\204,\213″
#”\203i\223\325C\20\177V\200\376\20\363″
#”\274\0361\306\355\”O\327\310\21\202\34]G\23\0023k\231w\266Uq\366\230″
#”\253\t\201K\323\260\224\”iZ\204-”
#”\311!\303\244\326\21\357\323\324\243\215i”
#”\353_\317T\337\220\266Y\263!\346x=b\214[‘O\323pe-\342E\326″
#”\6\367\31\267\3102\30\231\215I\354\325″
#”`\324\231\240\325%\322C\26?d\200\376\0207ysD\265\313\205_\263\a\274″
#”l\321C\332e\315*M\245\210K\305a\323d\3550\305\17\v \e\”O\23″
#”\352\372\334\0341R\327\360\b\2016\310\366\360Y\376\327\303Yo@J)Z,”
#”\311\372dZE\206)~\330\0\0\343\334\356’\22J=\357\327\204*\325\205p”
#”\r\222\365gO\241\276\317&\2126K”
#”\251\270T\302+\304\23\215\206\361\302p”
#”\364\f\e\0`\202\333\2758\215Z:`\213\363;\232\4r\20\213\367\e\306o”
#”\206{\355\377\2 \217\260\333\302>\273Y\0\0\0\0IEND\256B`\202″
) 0 0 17 3 22 #” =: contract violation”
0 0 17 29 1 #”\n”
0 0 17 3 19 #” expected: number?”
0 0 17 29 1 #”\n”
0 0 17 3 14 #” given: (1 2)”
0 0 17 29 1 #”\n”
0 0 17 3 24 #” argument position: 1st”
0 0 17 29 1 #”\n”
0 0 17 3 17 #” other arguments”
0 14 4 17 17 #”(#f (\” (1 2)\”))”
0 0 17 3 1 #”:”
0 0 17 29 1 #”\n”
0 0 17 3 11 #”> (= 3 3.0)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#t”
0 0 17 29 1 #”\n”
0 0 17 3 27 #”> (define x (list 1 2 3 4))”
0 0 17 29 1 #”\n”
0 0 17 3 27 #”> (define y (list 1 2 3 4))”
0 0 17 29 1 #”\n”
0 0 17 3 14 #”> (define z x)”
0 0 17 29 1 #”\n”
0 0 17 3 3 #”> x”
0 0 17 29 1 #”\n”
0 0 17 3 9 #”(1 2 3 4)”
0 0 17 29 1 #”\n”
0 0 17 3 3 #”> y”
0 0 17 29 1 #”\n”
0 0 17 3 9 #”(1 2 3 4)”
0 0 17 29 1 #”\n”
0 0 17 3 3 #”> z”
0 0 17 29 1 #”\n”
0 0 17 3 9 #”(1 2 3 4)”
0 0 17 29 1 #”\n”
0 0 17 3 11 #”> (eq? x y)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#f”
0 0 17 29 1 #”\n”
0 0 17 3 11 #”> (eq? x z)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#t”
0 0 17 29 1 #”\n”
0 0 17 3 31 #”> (eq? (+ 0.2 0.1) (+ 0.2 0.1))”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#f”
0 0 17 29 1 #”\n”
0 0 17 3 15 #”> (eq? 0.3 0.3)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#t”
0 0 17 29 1 #”\n”
0 0 17 3 29 #”> (eqv? (list 1 2)(list 1 2))”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#f”
0 0 17 29 1 #”\n”
0 0 17 3 12 #”> (eqv? x z)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#t”
0 0 17 29 1 #”\n”
0 0 17 3 31 #”> (eqv? (+ 0.2 0.1)(+ 0.2 0.1))”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#t”
0 0 17 29 1 #”\n”
0 0 17 3 11 #”> (eq? x y)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#f”
0 0 17 29 1 #”\n”
0 0 17 3 14 #”> (equal? x y)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#t”
0 0 17 29 1 #”\n”
0 0 17 3 3 #”> x”
0 0 17 29 1 #”\n”
0 0 17 3 9 #”(1 2 3 4)”
0 0 17 29 1 #”\n”
0 0 17 3 3 #”> y”
0 0 17 29 1 #”\n”
0 0 17 3 9 #”(1 2 3 4)”
0 0 17 29 1 #”\n”
0 0 17 3 14 #”> (equal? 3 3)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#t”
0 0 17 29 1 #”\n”
0 0 17 3 16 #”> (equal? 3 3.0)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#f”
0 0 17 29 1 #”\n”
0 0 17 3 16 #”> (define a ‘())”
0 0 17 29 1 #”\n”
0 0 17 3 16 #”> (define b ‘())”
0 0 17 29 1 #”\n”
0 0 17 3 3 #”> a”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”()”
0 0 17 29 1 #”\n”
0 0 17 3 3 #”> b”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”()”
0 0 17 29 1 #”\n”
0 0 17 3 11 #”> (eq? a b)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#t”
0 0 17 29 1 #”\n”
0 0 17 3 27 #”> (define x (list 1 2 3 4))”
0 0 17 29 1 #”\n”
0 0 17 3 9 #”> (car x)”
0 0 17 29 1 #”\n”
0 0 17 3 1 #”1″
0 0 17 29 1 #”\n”
0 0 17 3 9 #”> (cdr x)”
0 0 17 29 1 #”\n”
0 0 17 3 7 #”(2 3 4)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”> ”
0 0 17 29 1 #”\n”
0 0 17 3 13 #”(car (cdr x))”
0 0 17 29 1 #”\n”
0 0 17 3 1 #”2″
0 0 17 29 1 #”\n”
0 0 17 3 21 #”> (car (cdr (cdr x)))”
0 0 17 29 1 #”\n”
0 0 17 3 1 #”3″
0 0 17 29 1 #”\n”
0 0 17 3 10 #”> (cadr x)”
0 0 17 29 1 #”\n”
0 0 17 3 1 #”2″
0 0 17 29 1 #”\n”
0 0 17 3 11 #”> (caddr x)”
0 0 17 29 1 #”\n”
0 0 17 3 1 #”3″
0 0 17 29 1 #”\n”
0 0 17 3 12 #”> (cadddr x)”
0 0 17 29 1 #”\n”
0 0 17 3 1 #”4″
0 0 17 29 1 #”\n”
0 0 17 3 11 #”> (list? x)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#t”
0 0 17 29 1 #”\n”
0 0 17 3 11 #”> (list? 3)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#f”
0 0 17 29 1 #”\n”
0 0 17 3 11 #”> (null? x)”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#f”
0 0 17 29 1 #”\n”
0 0 17 3 13 #”> (null? ‘())”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#t”
0 0 17 29 1 #”\n”
0 0 17 3 13 #”> (eq? x ‘())”
0 0 17 29 1 #”\n”
0 0 17 3 2 #”#f”
0 0 17 29 1 #”\n”
0 0 17 3 3 #”> x”
0 0 17 29 1 #”\n”
0 0 17 3 9 #”(1 2 3 4)”
0 0 17 29 1 #”\n”
0 0 17 3 12 #”> (cons 0 x)”
0 0 17 29 1 #”\n”
0 0 17 3 11 #”(0 1 2 3 4)”
0 0 17 29 1 #”\n”
0 0 17 3 3 #”> x”
0 0 17 29 1 #”\n”
0 0 17 3 9 #”(1 2 3 4)”
0 0 17 29 1 #”\n”
0 0 17 3 12 #”> (cons x 5)”
0 0 17 29 1 #”\n”
0 0 17 3 15 #”((1 2 3 4) . 5)”
0 0 17 29 1 #”\n”
0 0 17 3 1 #”>”
0 0 17 29 1 #”\n”
0 0 26 3 2 #”|#”
0 0 26 29 1 #”\n”
0 0
(define (range a b)
(if (> a b) ‘()
(cons a (range (+ a 1) b))))
;(range 1 5)
;(cons 1 (range (+ 1 1) 5))
;(cons 1 (range 2 5))
;(cons 1 (cons 2 (range 3 5)))
;(cons 1 (cons 2 (cons 3 (range 4 5))))
;(cons 1 (cons 2 (cons 3 (cons 4 (range 5 5)))))
;(cons 1 (cons 2 (cons 3 (cons 4 (cons 5 (range 6 5))))))
;(cons 1 (cons 2 (cons 3 (cons 4 (cons 5 ‘())))))
;(cons 1 (cons 2 (cons 3 (cons 4 (list 5)))))
;(1 2 3 4 5)
(define (range-it a b)
(define (helper i L)
(if (< i a) L
(helper (- i 1)(cons i L))))
(helper b '()))
;(range-it 1 4)
;(helper 4 '())
;(helper (- 4 1)(cons 4 '()))
;(helper 3 (list 4))
;(helper (- 3 1)(cons 3 (list 4)))
;(helper 2 (list 3 4))
;(helper 1 (list 2 3 4))
;(helper 0 (list 1 2 3 4))
;(1 2 3 4)
(define (get-element L i)
(if (= i 0) (car L)
(get-element (cdr L) (- i 1))))
;(get-element (list 1 2 3 4) 2)
;(get-element (cdr (list 1 2 3 4)) (- 2 1))
;(get-element (list 2 3 4) 1)
;(get-element (list 3 4) 0)
;(car (list 3 4))
;3
(define (length L)
(if (null? L) 0
(+ 1 (length (cdr L)))))
;(length (list 1 2 3))
;(+ 1 (length (cdr (list 1 2 3))))
;(+ 1 (length (list 2 3)))
;(+ 1 (+ 1 (length (cdr (list 2 3)))))
;(+ 1 (+ 1 (length (list 3))))
;(+ 1 (+ 1 (+ 1 (length '()))))
;(+ 1 (+ 1 (+ 1 0)))
;...
;3
(define L1 (list 1 2 3))
(define L2 (list 4 5 6))
(define L3 (cons L1 L2))
(define (append L1 L2)
(if (null? L1) L2
(cons (car L1)
(append (cdr L1) L2))))
;(append (list 1 2)(list 3 4))
;(cons (car (list 1 2)) (append (cdr (list 1 2)) (list 3 4)))
;(cons 1 (append (list 2)(list 3 4)))
;(cons 1 (cons 2 (append '() (list 3 4))))
;(cons 1 (cons 2 (list 3 4)))
;...
;(list 1 2 3 4)
(define (scale-list L x)
(if (null? L) '()
(cons (* x (car L))
(scale-list (cdr L) x))))
;(scale-list (list 1 2 3) 10)
;(cons (* 10 (car (list 1 2 3))) (scale-list (cdr (list 1 2 3)) 10))
;(cons (* 10 1) (scale-list (list 2 3) 10))
;(cons 10 (scale-list (list 2 3) 10))
;(cons 10 (cons 20 (scale-list (list 3) 10)))
;(cons 10 (cons 20 (cons 30 (scale-list '() 10))))
;(cons 10 (cons 20 (cons 30 '())))
;...
;(list 10 20 30)
(define (map f L)
(if (null? L) '()
(cons (f (car L))
(map f (cdr L)))))
(define (filter predicate L)
(cond ((null? L) '())
((predicate (car L)) (cons (car L)
(filter predicate (cdr L))))
(else (filter predicate (cdr L)))))
;(filter odd? (list 1 2 3 4 5))
;(odd? (car (list 1 2 3 4 5)))
;(cons (car (list 1 2 3 4 5)) (filter odd? (cdr (list 1 2 3 4 5))))
;(cons 1 (filter odd? (list 2 3 4 5)))
;(cons 1 (filter odd? (list 3 4 5)))
;(cons 1 (cons 3 (filter odd? (list 4 5))))
;(cons 1 (cons 3 (filter odd? (list 5))))
;(cons 1 (cons 3 (cons 5 (filter odd? '()))))
;(cons 1 (cons 3 (cons 5 '())))
;..
;(list 1 3 5)
(define (reduce operator initial lis)
(if (null? lis) initial
(operator (car lis)
(reduce operator initial (cdr lis)))))
;(reduce + 0 (list 1 2 3))
;(+ 1 (reduce + 0 (list 2 3)))
;(+ 1 (+ 2 (reduce + 0 (list 3))))
;(+ 1 (+ 2 (+ 3 (reduce + 0 '()))))
;(+ 1 (+ 2 (+ 3 0)))
;..
;6
0
(define (reduce-it op total lis)
(if (null? lis) total
(reduce-it op (op total (car lis)) (cdr lis))))
;(reduce-it + 0 (list 1 2 3))
;(reduce-it + (+ 0 1) (cdr (list 1 2 3)))
;(reduce-it + 1 (list 2 3))
;(reduce-it + 3 (list 3))
;(reduce-it + 6 '())
;6
(reduce / 1 (list 10 2 2)) ;=> (10 / (2 / (2/1))) => 10 ;rFold
(reduce-it / 1 (list 10 2 2));=> ((1 / 10)/2)/2 => 1/40 ;lFold
;(define (delay exp)
; (lambda () exp)) ;error b/c applicative order
;(define (force delayed-exp)
; (delayed-exp))
(define-syntax delay
(syntax-rules ()
((delay exp) (lambda() exp))))
(define-syntax force
(syntax-rules ()
((force exp)(exp))))
(define (foo x y)
(if (= x 0) x (force y)))
(foo (* 3 0) (delay (/ 3 0)))
(define (prime? n)
(define (iter i)
(cond ((>= i (/ n 2)) #t)
((= 0 (modulo n i)) #f)
(else (iter (+ i 1)))))
(iter 2))
(define (filter pred lis) ;iterative version
(define (iter L result)
(cond ((null? L) result)
((pred (car L)) (iter (cdr L) (append result (list (car L)))))
(else (iter (cdr L) result))))
(iter lis ‘()))
(define (range a b)
(define (iter i result)
(cond ((< i a) result)
(else (iter (- i 1) (cons i result)))))
(iter b '()))
#|Lists:
range: (10000 10001 10002 ... 999999 1000000); ~1 million steps, O(n)
filter: (10007 10009 ... +~75k values); ~1million steps x prime? = O(n^2)
cdr: (10009 ... +~75k values) ; 1 step, but still storing ~75k values
car: 10009; 1 step
|#
#|Streams:
range: (10000 . #
filter: (10007 . #
cdr: (10009 . #
car: 10009 ;1 step
|#
;(define (stream-cons a b) ;error! b/c applicative order
; (cons a (delay b)))
;(stream-cons 1 (+ 1 1))
;(stream-cons 1 2)
;(cons 1 (delay 2))
;(1 . #
(define-syntax stream-cons
(syntax-rules ()
((stream-cons a b) (cons a (delay b)))))
(define (stream-car strm)
(car strm))
(define (stream-cdr strm)
(force (cdr strm)))
(define (stream-range a b)
(if (> a b) ‘()
(stream-cons a (stream-range (+ a 1) b))))
(define (range a b)
(if (> a b) ‘()
(cons a (range (+ a 1) b))))
;(stream-range 1 100))
;(stream-cons 1 (stream-range (+ 1 1) 100))
;(cons 1 (delay (stream-range (+ 1 1) 100)))
;(1 . [stream-range (+ 1 1) 100])
;(stream-cdr (stream-range 1 100))
;(stream-cdr (1 . [stream-range (+ 1 1) 100]))
;(force (cdr (1 . [stream-range (+ 1 1) 100])))
;(force [stream-range (+ 1 1) 100])
;(stream-range (+ 1 1) 100)
;(stream-range 2 100)
;(stream-cons 2 (stream-range (+ 2 1) 100))
;…
(define (stream-ref n strm)
(cond ((eq? strm ‘()) #f)
((= n 0) (stream-car strm))
(else (stream-ref (- n 1) (stream-cdr strm)))))
;(stream-ref 3 (stream-range 5 10))
;(stream-ref 3 (5 . [stream-range 6 10]))
;(stream-ref (- 3 1) (stream-cdr (5 . [stream-range 6 10])))
;(stream-ref 2 (force (cdr (5 . [stream-range 6 10]))))
;(stream-ref 2 (force [stream-range 6 10]))
;(stream-ref 2 (stream-range 6 10))
;(stream-ref 1 (stream-range 7 10))
;(stream-ref 0 (stream-range 8 10))
;(stream-car (8 . [stream-range 9 10]))
;8
(define (stream-filter pred strm)
(cond ((null? strm) ‘())
((pred (stream-car strm))
(stream-cons (stream-car strm)
(stream-filter pred (stream-cdr strm))))
(else (stream-filter pred (stream-cdr strm)))))
;(stream-filter even? (stream-range 1 10))
;(stream-filter even? (1 . [stream-range 2 10]))
;(stream-filter even? (stream-cdr (1 . [stream-range 2 10])))
;(stream-filter even? (stream-range 2 10))
;(stream-filter even? (2 . [stream-range 3 10]))
;(stream-cons (stream-car (2 . [stream-range 3 10])) (stream-filter even? (stream-cdr (2 . [stream-range 3 10])))
;(cons (stream-car (2 . [stream-range 3 10])) (delay (stream-filter even? (stream-cdr (2 . [stream-range 3 10])))))
;(cons 2 [stream-filter even? (stream-cdr (2 . [stream-range 3 10]))])
;(2 . #
(define (ints-starting-from i)
(stream-cons i (ints-starting-from (+ i 1))))
(define sevens
(stream-filter (lambda(x)(= (modulo x 7) 0)) (ints-starting-from 1)))
(define x 0)
(define y 3)
(define (bindEg)
(define x (+ y 100))
x)
(define (assignEg)
(set! x (+ y 100))
x)
(define (factorial n)
(define (iterate product counter)
(if (> counter n)
product
(iterate (* counter product) (+ counter 1))))
(iterate 1 1))
(define (factorial n)
(let ((product 1)
(counter 1))
(define (iterate)
(if (> counter n)
product
(begin
(set! counter (+ counter 1))
(set! product (* counter product))
(iterate))))
(iterate)))
(define (incr x)
(begin
(set! x (+ x 1))
x))
;(incr 3)
;(begin (set! x (+ 3 1)) 3)
;3
(+ 1 2)
(display “Hello scheme!”)
; line comment
3
#| block
comment
on multiple
lines |#
(+ (* (+ 1 2)
(+ (* 2 4)
(+ 3 5)))
(+ (- 10 7) 6))
; 7-4*10+12
(+ (- 7 (* 4 10)) 12)
; 6/3+9*2-7+(3+4*2)
(+ (- (+ (/ 6 3) (* 9 2)) 7) (+ 3 (* 4 2)))
(+ (/ 6 3) (* 9 2) (- 7) (+ 3 (* 4 2)))
(* (+ 2 (* 4 6))(+ 3 5 7))
(+ 2 (* (- (+ 3 4)(+ 5 1))2))
(or (and (< 6 7) #t)(or (not #f)(= 7 3)))(define pi 3.141592653589)
;doesn't matter how pi is defined
(define pi (/ 355 113.0))
(define pi (/ 22.0 7))
(define radius 10)
(define circumference (* 2 pi radius))
(define height 20)
(define areaCylinder1 (+ (* circumference height) (* 2 pi (* radius radius))))
(define areaCylinder2 (+ (* (* 2 (/ 22.0 7) 10) 20) (* 2 (/ 22.0 7) (* 10 10))))
(define a "hello\n")
(define b " world")
(display a)(display b)
;(< a b)
(newline)
(display (+ 7 4))
(define userInput (read))(define (square x)(* x x))
(define a (* 5 5))
(define (b) (* 5 5))
(define (sum-of-squares x y)
(+ (square x)
(square y)))
(define (f a) (sum-of-squares (+ a 1) (* a 2)))
(define (pretty-sum a b)
(display a)(display " + ")(display b)
(newline)(display " = ")
(+ a b))
(define (myfunc a)
(+ a 1)
(* a 2)
(- a a)
a)
(myfunc 17);eval: (+ 1 (* 2 3)) => 7
; eval: + => #
; eval: (* 2 3) => 6
; eval: * => #
; eval: 3 => 3
; apply: #
; apply: + to 1,6 => 7
(define (double x)(+ x x))
;eval: (double 5) =>10
; eval: double => #
; apply: double to 5
; eval: (+ 5 5)
; eval: +
; eval: 5
; eval: 5
; apply: + to 5,5 => 10
;example substitution model
(double 5)
(+ 5 5)
10
;some functions
(define (square x)(* x x))
(define (sos x y)(+ (square x)(square y)))
(define (f a)(sos (+ a 1)(* a 2)))
;substitution model
(f 5)
(sos (+ 5 1)(* 5 2))
(sos 6 10)
(+ (square 6)(square 10))
(+ (* 6 6)(* 10 10))
(+ 36 100)
136
;special form
(define newVar (+ 1 2)) ;some functions
(define (square x)(* x x))
(define (sos x y)(+ (square x)(square y)))
(define (f a)(sos (+ a 1)(* a 2)))
;substitution model (applicative order)
;(f 5)
;(sos (+ 5 1)(* 5 2))
;(sos 6 10)
;(+ (square 6)(square 10))
;(+ (* 6 6)(* 10 10))
;(+ 36 100)
;136
;substitution model (normal order)
;(f 5)
;(sos (+ 5 1)(* 5 2))
;(+ (square (+ 5 1))(square (* 5 2))
;(+ (* (+ 5 1)(+ 5 1)) (square (* 5 2)))
;(+ (* 6 6) (square (* 5 2)))
;(+ 36 (square (* 5 2)))
;(+ 36 (* (* 5 2)(* 5 2)))
;(+ 36 (* 10 10))
;(+ 36 100)
;136
;(f 5)
;(sos (+ 5 1)(* 5 2))
;(+ (square (+ 5 1))(square (* 5 2)))
;(+ (* (+ 5 1)(+ 5 1)) (* (* 5 2)(* 5 2)))
;(+ (* 6 6)(* 10 10))
;(+ 36 100)
;136
(define (max x y)
(if (>= x y) x y))
(define (example x y z)
((if (> x 5) + *)
(if (< y 10) y z)
(if (and (< x y)(< z y))
(- y x)
(* x z))))
(example 10 2 3)
;substitution model
;(example 10 2 3)
;((if (> 10 5) + *)(if (< 2 10) 2 3)(if (and (< 10 2)(< 3 2))(- 2 10)(* 10 3)))
;((if #t + *)(if (< 2 10) 2 3)(if (and (< 10 2)(< 3 2))(- 2 10)(* 10 3)))
;(+ (if (< 2 10) 2 3)(if (and (< 10 2)(< 3 2))(- 2 10)(* 10 3)))
;(+ (if #t 2 3)(if (and (< 10 2)(< 3 2))(- 2 10)(* 10 3)))
;(+ 2 (if (and (< 10 2)(< 3 2))(- 2 10)(* 10 3)))
;(+ 2 (if (and #f (< 3 2))(- 2 10)(* 10 3)))
;(+ 2 (if #f (- 2 10)(* 10 3)))
;(+ 2 (* 10 3))
;(+ 2 30)
;32
;(example 10 2 3)
;((if (> 10 5) + *)(if (< 2 10) 2 3)(if (and (< 10 2)(< 3 2))(- 2 10)(* 10 3)))
;(+ (if (< 2 10) 2 3)(if (and (< 10 2)(< 3 2))(- 2 10)(* 10 3)))
(define (signum x)
(if (> x 0) 1
(if (< x 0) -1 0)))
(define (signum2 x)
(cond ((> x 0) 1)
((< x 0) -1)
((= x 0) 0)))
;substitution model
;(signum2 -3)
;(cond ((> -3 0) 1)((< -3 0) -1)((= -3 0) 0))
;(cond (#f 1)((< -3 0) -1)((= -3 0) 0))
;(cond (#f 1)(#t -1)((= -3 0) 0))
;-1
;(signum2 -3)
;(cond ((> -3 0) 1)((< -3 0) -1)((= -3 0) 0))
;-1
(define (signum3 x)
(cond ((> x 0) (display “positive”) 1)
((< x 0) (display "negative") -1)
(else (display "zero") 0)))