Page 1 of 1

## 1 Replies - 366 Views - Last Post: 17 June 2017 - 05:46 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=404655&amp;s=00c21fd879b777013ff895b01c48681a&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 Jerence

Reputation: 0
• Posts: 1
• Joined: 17-June 17

Posted 17 June 2017 - 02:15 AM

(define(sum-of-square x y)(+(* x x)(* y y)))
(define(A x y z)(cond((>= x y z)(sum-of-square x y))((>= x z y)(sum-of-square x z))
((>= y x z)(sum-of-square y x))((>= y z x)(sum-of-square y z))
((>= z x y)(sum-of-square z x))((>= z y x)(sum-of-square z y))))

(A 1 2 3)

SchemeError: Expected 2 arguments, got 3

Current Eval Stack:
-------------------------
0: (>= x y z)
1: (A 1 2 3)

Hello everyone! I am a computer science beginner now reading SICP. There is an exercise in the book: define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers. I typed the codes above and the interpreter said it was wrong. So can anyone please point out where the error is? Thank you so much!

Is This A Good Question/Topic? 0

## Replies To: Question about Scheme Language

### #2 sepp2k

• D.I.C Lover

Reputation: 2511
• Posts: 3,983
• Joined: 21-June 11

## Re: Question about Scheme Language

Posted 17 June 2017 - 05:46 AM

The error message seems to be suggesting that >= can only be used with two arguments, but both the R5RS and the R6RS standard say that >= is variadic. I've also tested your code in three different Scheme implementations (Racket, Guile and TryScheme) and it worked fine in all three.

So which Scheme implementation are you using? Maybe it's broken or incomplete.