首页 文章

常见的lisp,未定义的交集函数行为?

提问于
浏览
6

根据CLHS条目的INTERSECTION功能(http://www.lispworks.com/documentation/HyperSpec/Body/f_isec_.htm):

对于满足测试要求的每一对,该对中的两个元素中的一个将被放入结果中 .

我的问题是我需要知道对中的 which one of the two elements 将被放入结果中,这很重要,例如 :key #'car 用于提取参数以进行测试,因为cdr可能不同 . 我想保证始终将第一个元素或第二个元素放在结果中 . 我错过了什么或者这只是未指明的行为,所以我不应该将它用于我的情况?

1 回答

  • 6

    intersection 根本没有't make the guarantee you want; it implements set-theoretic intersection with a lot of extras, but just not that extra. You'我必须自己滚动 .

相关问题