LispForum

You have problems, and we're glad to hear them. Explain the problem, what you have tried, and where you got stuck.Feel free to share a little info on yourself and the course.

Forum rules
Please respect your teacher's guidelines. Homework is a learning tool. If we just post answers, we aren't actually helping. When you post questions, be sure to show what you have tried or what you don't understand.

The reason fo that is because you have no stop condition for when the function has failed to find a sublist. the final tail of a proper list is nil and (car nil) is nil. nil is a list.

The logic must check if the list is the empty list and return nil.if it is not then you can do the rest your function is doing and it will work.Since this will have 3 terms I would have used cond instead of if but that is just a style suggestion.