Common Lisp: How to check set equality, ignoring order?
Similar to this question:
Setting up a equal function in common lisp using only "eq"
except, I'd like to be compare two sets for equality, disregard开发者_如何学Pythoning order. How would I do this?
There are a number of set functions in CL. Among those you can use (null (set-exclusive-or set-a set-b))
.
This may not be the answer that you are looking for, but if you want to deal with sets, I recommend using Fset, a functional set-theoretic collections library for CL. The tutorial gives a good idea of what it does.
精彩评论