I am picking up scheme as a way to learn recursive and I found it very good for me:D But now, I have a question. How would i make a function called thirds that picks one element and skips 2 and repeats the process over. So it returns a new list with the first element from, every triple of elements For example (thirds '(a b c d e f g h))
should return
(a d g)
(DEFINE (thirds lst)
(COND
((NOT(list? lst)) (newline) "USAGE: (thirds [list])")
((NULL? lst) lst)
((NULL? (CDR lst)) (CAR lst))
(ELSE (CONS (CAR lst) (thirds (CDR(CDR(CDR lst)))) )) ))
thats the code i have tried but not any real luck.. any help?