Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Help with SICP

Name: Anonymous 2008-01-06 22:44

http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-10.html#%_sec_1.1.6
Exercise 1.3 is a bitch. I think I'm close to a solution, then I see a fundamental flaw, and have to rewrite it. My notebook paper hurts.

Name: Anonymous 2008-01-07 12:09

OP here, with the newfound simplicity in this exercise, I can change my code to

define (square x) (* x x))

(define (sum-of-squares x y)
  (+ (square x) (square y)))

(define (square-largest x y z)
  (cond (and (< x y) (< x z)) (define a y) (define b z)
    (and (< y x) (< y z)) (define a x) (define b z)
    (else (define a x) (define b y)))
  (sum-of-squares a b))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List