I am learning scheme and one of the things I have to do is recursion to figure out if the list is reflective, i.e. the list looks the same when it is reversed. I have to do it primitively so I can't use the reverse method for lists. I must also use recursion which is obvious. The problem is in scheme it's very hard to access the list or shorten the list using the very basic stuff that we have learned, since these are kinda of like linkedlists. I also want to do without using indexing. With that said I have a few ideas and was wondering If any of these sufficient and do you think I could actually do it better with the basics of scheme.
- Reverse the list using recursion (my implementation) and compare the original and this rev. list.
- Compare the first and last element by recursing on the rest of the list to find the last element and compare to first. Keeping track of how many times I have recursed and then do it one less for the second last element of the list, to compare to the second element of the list. (This is very complicated to do as I've tried it and wound up failing but I want to see you guys would've done the same)
- Shorten the list to trim off the first and last element each time and compare. I'm not sure if this can be done using the basics of scheme.
- Your suggestions or hints or anything. I'm very new to scheme. Thanks for reading. I know it's long.