I have the following code:
(define numbers '(2 3 5 3 1 22 2))
(define (count val l)
(if (null? l)
0
(+
(if (= (first l) val) 1 0)
(count val (rest l))
)
)
)
(display (count 6 numbers))
(sorry if my code looks awful, only have to use this language for one time)
the compiler says:
count: contract violation
expected: procedure?
given: 6
argument position: 1st
other arguments...:
'(3 5 3 1 22 2)