list - Lisp,如何从列表中删除元素列表?

标签 list lisp

是否有内置(无外部库)方法从列表中删除元素列表?

(remove-elements '("a" "b" "c" "d") '("b" "c"))

到:

("a" "d")

或者您是否必须编写自己的函数,如果是这样,这样的函数看起来如何?

最佳答案

如果顺序不重要,请使用 SET-DIFFERENCE功能:

(set-difference '("a" "b" "c" "d") '("b" "c") :test #'string=)

关于list - Lisp,如何从列表中删除元素列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46574567/

相关文章:

Python:这里使用 [] 是什么意思?

assembly - 在编译器中实现闭包

scheme - Lisp/方案 : Progn vs And

python - 二维列表不起作用

python - 比较两个列表并找到变化的索引

c# - 为什么我不能用 List<Tuple<string, bool>> 实例化 List<Object>?

python - 在python中绑定(bind)局部变量

python - 计算列表中的元组,无论元组中每个元素的顺序如何

c++ - Lisp 和 Android NDK

emacs - 对 "wrong-type-argument"使用react