Search code examples
lispcommon-lisp

Is there a common LISP function to compare the contents of two lists?


In particular, I just want to ensure that two lists have the same elements, ignoring order


Solution

  • According to Steele "set-difference returns a list of elements of list1 that do not appear in list2. This operation is not destructive."

    So if the set-difference is empty and the lengths are the same...

    http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node152.html#SECTION001950000000000000000