■
問題1.3。
gosh> (define (f x y z) (cond ((and (> x z) (> y z) ) (* x y))) (cond ((and (> x y) (> z y) ) (* x z))) (cond ((and (> y x) (> z x) ) (* y z))) ) f gosh> (f 1 2 3) 6 gosh> (f 1 1 1) #<undef> gosh>
ふむ。予定通り同値でundef。
…>=をdefineすればいいのか。
gosh> (define (>= x y) (not (< x y))) (define (f x y z) (cond ((and (>= x z) (>= y z) ) (* x y))) (cond ((and (>= x y) (>= z y) ) (* x z))) (cond ((and (>= y x) (>= z x) ) (* y z))) ) >= gosh> f gosh> (f 1 1 1) 1 gosh> (f 1 2 3) 6 gosh>
エディタからコピーアンドペーストしたからプロンプトがおかしいけどまあそんな感じ。