I have a program that takes in an input like '((1 plus 2) (2 times 2)). However, when I run that example input, it only prints out '(3). How can I change this code to parse through the whole list that I give it and not just the first instance in the list?
(define math (lambda (lst) (cond [(null? lst) lst] [(equal? (second (car lst)) 'plus) (cons (+ (first (car lst)) (third (car lst))) '())] [(equal? (second (car lst)) 'times) (cons (* (first (car lst)) (third (car lst))) '())]) ))