是否有一个通用的LISP函数来比较两个列表的内容? [英] Is there a common LISP function to compare the contents of two lists?
本文介绍了是否有一个通用的LISP函数来比较两个列表的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
特别是,我只想确保两个列表具有相同的元素,而忽略顺序
In particular, I just want to ensure that two lists have the same elements, ignoring order
推荐答案
根据Steele的说法,设置差异返回list1中没有出现在list2中的元素的列表.此操作不是破坏性的."
According to Steele "set-difference returns a list of elements of list1 that do not appear in list2. This operation is not destructive."
因此,如果set-difference为空并且长度相同...
http://www.cs. cmu.edu/Groups/AI/html/cltl/clm/node152.html#SECTION001950000000000000000
这篇关于是否有一个通用的LISP函数来比较两个列表的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文