I have a list that is filled with lists, some of which are null. My function is going through the main list and checking if there are any empty lists. If empty, it eliminates them (or should). I keep getting a car: contract violation error that tells me it is expecting a pair but getting a '(). I am not sure how to change it to not get this error.
(define (take-out-nulls alist)
(cond ((null? (car alist)) (take-out-nulls (cdr alist)))
(#t (cons (car alist)(take-out-nulls (cdr alist))))))