Joe Cardillo
1 min readMar 24, 2019

--

Hi Sunny Yuen — that’s a great question! Logically, that would make sense. But the reason you can exclude the + operator is because the sum-of-squares function was already defined earlier to include the addition operator, like this:

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

It would be the same as defining add like this:

(define (add x y) 
(+ x y))

Then if you were to feed this function two parameters like this:

(add 2 3)

You would get 5. In other words, you wouldn’t need to include the + operator, like this:

(add (+ 2 3)

Because it’s already built into the add function.

--

--

Joe Cardillo
Joe Cardillo

Written by Joe Cardillo

Solutions Architect at Akamai Cloud

No responses yet