Cool stuff!
I think it would be fun to solve the first several problems with recursions (attempting yourself ofcourse, no hinting with the answers).
Ha! I don't know Autolisp anymore (I moved on to other languages a long time ago). Besides, no one want's me back in the lisp world; I think they still have a few t-shirts with some of my "logic rants" on them.
Sounds like you are just learning about recursion. Recursion is very natural and powerful but you need to understand when and when not to use it. For example (step one), do you understand what is meant when AutoCAD returns something about a stack limit/error?
Anyways, I'll take you up on your challenge to do the first few myself. However, recursion certainly isn't needed for those simple ones. If I remember right, Autolisp has a "LAST" function so my first attempt will try to NOT use it (keep with the spirit of the test).
#1
#2
; (my-but-last '(a b c d))
...
#8 (almost; I wanted to `use recursion' as requested and this was kind of an attempt down the path of removing duplicates).
(defun remove
-duplicates
( lst
) nil
'nil
(remove
-duplicates
(cdr lst
))) ))
; (clean-list (remove-duplicates '(a a a a b c c a a d e e e e)))
Well, that was fun. Thanks for the challenge. Take care.