List position mapping in common lisp
|Added at||2016-12-28 21:12|
I have 3 lists, where the first 2 lists have the same size and the third one is a sublist of the first. Lets say list1 is '(X Y Z W), list2 is '(1 2 3 4) and list3 is '(X Z) I need to get as result a sublist of the second one without the positions missing in list3 from list1, so in this case the result should be (1 3).
To get the position on an element I can write something like this:
That will return the 0 based position of the element. But I'm not sure about how to continue my function..