recently, i'm learning sicp but I meet a strange question :
Error: remainder: contract violation expected: integer? given: '(3 4 5 6) argument position: 1st other arguments...: 2
here's my code
(define (same-parity sample . other)
(if (null? other)
(cons sample '())
(if (= (remainder sample 2) (remainder (car other) 2))
(cons (car other) (same-parity sample (cdr other)))
(same-parity sample (cdr other)))))
(same-parity 1 2 3 4 5 6)
- os: win10
- lang: racket v6.10.1
It tell remainder expected a integer param I think I given a integer to remainder not a list. So can someone tell my what's wrong with my code. I am in a great quandary. thank in advance.