All pastes #1619552 Raw Edit

SICP 1.3

public text v1 · immutable
#1619552 ·published 2009-10-14 14:48 UTC
rendered paste body
(define (println x) (display x) (display "\n"))

(define (square x) (* x x))
(define (bigger x y) (if (> x y) x y))

(define 
    (proc x y z)
    (+ 
        (square (bigger x y)) 
        (if (> x y) 
            (square (bigger y z)) 
            (square (bigger x z))
        )
    )
)

(println (proc 1 2 3))
(println (proc 5 1 4))
(println (proc 6 5 4))