Skip to content
Create a gist now

Instantly share code, notes, and snippets.

(define (sum-of-largest-two-squared a b c)
(define (square x) (* x x))
(define smallest-squared (cond ((and (< a b) (< a c)) (square a))
((and (< b a) (< b c)) (square b))
(else (square c))))
(define all-squared (+ (square a) (square b) (square c)))
(- all-squared smallest-squared))
(sum-of-largest-two-squared 1 2 3)
; *** ERROR IN sum-of-largest-two-squared, "1/3.scm"@3.63 -- Operator is not a PROCEDURE
; using gambit scheme (scheme r5rs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.