I'm having a bit of trouble implementing this program in Scheme, although I think I'm 90% of the way there. Unfortunately I need to be a little vague about it since this is a homework assignment. I want to (A B C D ) to return ( B D) . but i am getting an error that says The object (), passed as an argument to safe-car, is not a pair | " This is my code:
(DEFINE (other_el lis) (COND (( NULL? lis ) '()) ((LIST? lis) (append (CADR lis) (other_el (CDR lis)))) (ELSE (show " USAGE: (other_el [LIST])"))))
cddr?