I'm trying to figure out how to work through a list in reverse order (back to front) in Scheme using recursion. My research shows that there is a reverse function that you can use on a list but I would not like to go that route.
I know that the following returns the last element in a list;
(caddr '(1 5 3))
returns 3
I would like to be able to send the remaining 1 5 back through the function, look at the last element again and repeat until the list is exhausted
From left to right is simple enough, you look at the car of the list and send back the cdr.
caddrdoes not return the last element in 'a list'; it returns the last element in 'your list'. - GoZonerreverse? - ceving