(define str '("3" "+" "3"))
(define list '(3 + 4))
(define (tokes str)
(case (car str)
((or "+" "-" "*" "/")(write "operand")
(tokes (cdr str)))
(else (write "other"))
))
(define (tokelist)
(case (car list)
((or "+" "-" "*" "/")(write "operand"))
(else (write "other"))))
(define str ‘(3 + 3)) (define list ‘(3 + 4)) (define (tokes str) (case
Share
You are trying to compare a String
"+"with the procedure+when you’re working with the list. These are different types, and they are not equal.Try this:
This should give you a good idea of how to solve the problem, but note:
You need:
Using these ideas, this should get your code working: