0
最近,我正在学习SiC颗粒,但我遇到一个奇怪的问题:约球拍其余部分预计PARAMS
Error: remainder: contract violation expected: integer? given: '(3 4 5 6) argument position: 1st other arguments...: 2
这里是我的代码
(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)
- 操作系统:win10
- lang:racket v6.10.1
它告诉其余的整数参数 我想我给了一个整数余数不是一个列表。那么有人可以告诉我我的代码有什么问题。我很尴尬。预先感谢。
谢谢它完美的解决了我的问题 – Ceuvres