Scheme, "application: not a procedure"

Viewed 22

When I try to call the subtotal function, I get the error "application: not a procedure; expected a procedure that can be applied to arguments given: 1

(define (subtotal id-list)

(if (null? id-list)

0

(+ (getprice(car id-list)) (subtotal (cdr id-list)))))

(subtotal (list (1 2 3)))

The getprice function works fine, so I don't know why it thinks subtotal isn't a procedure.

0 Answers
Related