摘要:
(define (p) (p))(define (test x y) (if (= x 0) 0 y))(test 0 (p)) 哇,这么快就印证了我的想法了吗. 首先用R5RS跑一遍,啥都没有.然后切换成Lazy Racket,结果为0. 解释:前者是应用序,p一传进来就求值,不断的调用自己,无限 阅读全文
posted @ 2017-11-22 12:10
R4mble
阅读(304)
评论(0)
推荐(0)
摘要:
(define (a-plus-abs-b a b) (if (> b 0) (+ a b) (- a b)) )(define (a-plus-abs-b-book a b) ((if (> b 0) + -) a b) )(a-plus-abs-b 1 -1)(a-plus-abs-b-book 阅读全文
posted @ 2017-11-22 11:56
R4mble
阅读(191)
评论(0)
推荐(0)
摘要:
(define (SumOfTwoLarge x y z) (if (and (<= x y) (<= x z)) (+ (* y y) (* z z)) (SumOfTwoLarge y x z)) )(SumOfTwoLarge 0 2 2) 感觉我这个很取巧啊,哈哈哈哈. 我还是有点不习惯把函 阅读全文
posted @ 2017-11-22 11:44
R4mble
阅读(120)
评论(0)
推荐(0)
摘要:
(/ (+ 5 4(- 2 (- 3 (+ 6 (/ 4 5))))) (* 3 (- 6 2) (- 2 7))) 注意: (- 1 1 1 1)这样写也可以 阅读全文
posted @ 2017-11-22 11:27
R4mble
阅读(207)
评论(0)
推荐(0)
摘要:
(define a 3) (define b (+ a 1)) b (+ a b(* a b)) (= a b) (if (and (> b a) (< b (* a b))) b a) (cond ((= a 4) 6) ((= b 4) (+ 6 7 a)) (else 25)) (+ 2 (i 阅读全文
posted @ 2017-11-22 11:26
R4mble
阅读(315)
评论(0)
推荐(0)
浙公网安备 33010602011771号