开发者

Common Lisp: How to check set equality, ignoring order?

开发者 https://www.devze.com 2023-02-09 21:30 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消