public
Last active

  • Download Gist
gistfile1.sls
Scheme
1 2 3 4 5 6 7 8 9 10 11 12
(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)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.