I'm trying to learn scheme and trying some solutions from this thread. SICP Exercise 1.3 request for comments
I'm also interested in emacs, so I start both together. In emacs I'm using Racket v6.1.
My problem, strange behavior of one solution:
(define (square x) (* x x))
(define (sum-of-squares x y)
(+ (square x) (square y)))
(define (min x y)
(if (< x y) x y))
(define (min x y)
(if (< x y) x y))
(define (solution a b c)
(sum-of-squares (square (max a b)) (square (max c (min a b)))))
(solution 2 3 4)
337
(solution 1 2 3)
97
No clue what's going on. Expected first 25 and second 13.