| So I was try a program from SICP, which takes a list a value and returns the number of ways to make change for the value based on the ones in the list... this went fine till I tried running it, at which point it told me:
car: expects argument of type <pair>; given '()
the code I used is:
(define (List-coins Val Coin)
(cond ((= 0 Val) 1)
((< Val 0) )
(else (+
(List-coins (- Val (car Coin)) Coin)
(if (null? Coin)
0
(List-coins Val (cdr Coin))))))) anyone have any ideas? |