Skip to content

Commit

Permalink
push 4.31 upward compat
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilliamson1 committed May 1, 2021
1 parent 22b3549 commit 17e1af0
Show file tree
Hide file tree
Showing 3 changed files with 13,951 additions and 5,422 deletions.
35 changes: 35 additions & 0 deletions 4.31-test-inputs.rkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#lang racket
(define (unless pred con alt)(if pred alt con))
(unless (> 10 5) (/ 1 0) 5)
(define (unless pred (con lazy) alt)(if pred alt con))
(unless (> 10 5) (/ 1 0) 5)
(define (unless pred (con lazy-memo) alt)(if pred alt con))
(unless (> 10 5) (/ 1 0) 5)
(define (fib (n lazy-memo))
(let fib-iter (((a lazy-memo) 1) ((b lazy-memo) 0) (count n))
(if (= count 0)
b
(fib-iter (+ a b)
a
(- count 1)))))

(define (fib n)
(if (= n 1)
0
(if (= n 2)
1
(+ (fib (- n 1)) (fib (- n 2))))))

(define (fib (n lazy))
(if (= n 1)
0
(if (= n 2)
1
(+ (fib (- n 1)) (fib (- n 2))))))

(define (fib (n lazy-memo))
(if (= n 1)
0
(if (= n 2)
1
(+ (fib (- n 1)) (fib (- n 2))))))
Loading

0 comments on commit 17e1af0

Please sign in to comment.